mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
parent
ed3015c350
commit
bca2d38e52
1 changed files with 25 additions and 0 deletions
|
@ -16,6 +16,7 @@ package tpl
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"errors"
|
"errors"
|
||||||
|
"html/template"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"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
|
// Test for bugs discovered by https://github.com/dvyukov/go-fuzz
|
||||||
func TestTplGoFuzzReports(t *testing.T) {
|
func TestTplGoFuzzReports(t *testing.T) {
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue