shithub: hugo

Download patch

ref: bca2d38e52a1f990892ef1de4a2724aa27f55a22
parent: ed3015c35014089deb3b9dae03d0997c04f0834c
author: Bjørn Erik Pedersen <[email protected]>
date: Wed Jan 13 09:09:24 EST 2016

Add temporary template test for linux/arm

See #1771

--- a/tpl/template_test.go
+++ b/tpl/template_test.go
@@ -16,6 +16,7 @@
 import (
 	"bytes"
 	"errors"
+	"html/template"
 	"io/ioutil"
 	"os"
 	"path/filepath"
@@ -88,6 +89,30 @@
 			}
 		}
 	}
+
+}
+
+// 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)
 
 }