mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-28 22:19:59 +02:00
@@ -492,7 +492,7 @@ var errorTests = []parseTest{
|
||||
hasError, `unclosed left paren`},
|
||||
{"rparen",
|
||||
"{{.X 1 2 3 ) }}",
|
||||
hasError, `unexpected ")" in command`},
|
||||
hasError, "unexpected right paren"},
|
||||
{"rparen2",
|
||||
"{{(.X 1 2 3",
|
||||
hasError, `unclosed action`},
|
||||
@@ -600,7 +600,8 @@ func TestBlock(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestLineNum(t *testing.T) {
|
||||
const count = 100
|
||||
// const count = 100
|
||||
const count = 3
|
||||
text := strings.Repeat("{{printf 1234}}\n", count)
|
||||
tree, err := New("bench").Parse(text, "", "", make(map[string]*Tree), builtins)
|
||||
if err != nil {
|
||||
@@ -614,11 +615,11 @@ func TestLineNum(t *testing.T) {
|
||||
// Action first.
|
||||
action := nodes[i].(*ActionNode)
|
||||
if action.Line != line {
|
||||
t.Fatalf("line %d: action is line %d", line, action.Line)
|
||||
t.Errorf("line %d: action is line %d", line, action.Line)
|
||||
}
|
||||
pipe := action.Pipe
|
||||
if pipe.Line != line {
|
||||
t.Fatalf("line %d: pipe is line %d", line, pipe.Line)
|
||||
t.Errorf("line %d: pipe is line %d", line, pipe.Line)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user