mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-26 22:04:32 +02:00
tpl/internal: Synch Go templates fork with Go 1.16dev
This commit is contained in:
@@ -11,7 +11,7 @@ import (
|
||||
"errors"
|
||||
"flag"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"io"
|
||||
"reflect"
|
||||
"strings"
|
||||
"testing"
|
||||
@@ -1297,7 +1297,7 @@ func TestUnterminatedStringError(t *testing.T) {
|
||||
t.Fatal("expected error")
|
||||
}
|
||||
str := err.Error()
|
||||
if !strings.Contains(str, "X:3: unexpected unterminated raw quoted string") {
|
||||
if !strings.Contains(str, "X:3: unterminated raw quoted string") {
|
||||
t.Fatalf("unexpected error: %s", str)
|
||||
}
|
||||
}
|
||||
@@ -1330,7 +1330,7 @@ func TestExecuteGivesExecError(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
err = tmpl.Execute(ioutil.Discard, 0)
|
||||
err = tmpl.Execute(io.Discard, 0)
|
||||
if err == nil {
|
||||
t.Fatal("expected error; got none")
|
||||
}
|
||||
@@ -1476,7 +1476,7 @@ func TestEvalFieldErrors(t *testing.T) {
|
||||
for _, tc := range tests {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
tmpl := Must(New("tmpl").Parse(tc.src))
|
||||
err := tmpl.Execute(ioutil.Discard, tc.value)
|
||||
err := tmpl.Execute(io.Discard, tc.value)
|
||||
got := "<nil>"
|
||||
if err != nil {
|
||||
got = err.Error()
|
||||
@@ -1493,7 +1493,7 @@ func TestMaxExecDepth(t *testing.T) {
|
||||
t.Skip("skipping in -short mode")
|
||||
}
|
||||
tmpl := Must(New("tmpl").Parse(`{{template "tmpl" .}}`))
|
||||
err := tmpl.Execute(ioutil.Discard, nil)
|
||||
err := tmpl.Execute(io.Discard, nil)
|
||||
got := "<nil>"
|
||||
if err != nil {
|
||||
got = err.Error()
|
||||
|
Reference in New Issue
Block a user