From bca2d38e52a1f990892ef1de4a2724aa27f55a22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Wed, 13 Jan 2016 14:09:24 +0100 Subject: [PATCH] Add temporary template test for linux/arm See #1771 --- tpl/template_test.go | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/tpl/template_test.go b/tpl/template_test.go index 76afff25a..18454bf51 100644 --- a/tpl/template_test.go +++ b/tpl/template_test.go @@ -16,6 +16,7 @@ package tpl import ( "bytes" "errors" + "html/template" "io/ioutil" "os" "path/filepath" @@ -91,6 +92,30 @@ html lang=en } +// A Go stdlib test for linux/arm. Will remove later. +// See #1771 +func TestBigInteger(t *testing.T) { + var func1 = func(v int64) error { + return nil + } + var funcs = map[string]interface{}{ + "A": func1, + } + + tpl, err := template.New("foo").Funcs(funcs).Parse("{{ A 3e80 }}") + if err != nil { + t.Fatal("Parse failed:", err) + } + err = tpl.Execute(ioutil.Discard, "foo") + + if err == nil { + t.Fatal("Execute should have failed") + } + + t.Log("Got expected error:", err) + +} + // Test for bugs discovered by https://github.com/dvyukov/go-fuzz func TestTplGoFuzzReports(t *testing.T) {