MCPcopy Create free account
hub / github.com/CloudyKit/jet / TestUsefulErrorOnLateImportOrExtends

Function TestUsefulErrorOnLateImportOrExtends

parse_test.go:88–92  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

86}
87
88func TestUsefulErrorOnLateImportOrExtends(t *testing.T) {
89 p := ParserTestCase{T: t}
90 p.ExpectError("late_import.jet", `<html><head>{{import "./foo.jet"}}</head></html>`, "template: late_import.jet:1: parsing command: unexpected keyword 'import' ('import' statements must be at the beginning of the template)")
91 p.ExpectError("late_extends.jet", `<html><head>{{extends "./foo.jet"}}</head></html>`, "template: late_extends.jet:1: parsing command: unexpected keyword 'extends' ('extends' statements must be at the beginning of the template)")
92}
93
94func TestKeywordsDisallowedAsBlockNames(t *testing.T) {
95 p := ParserTestCase{T: t}

Callers

nothing calls this directly

Calls 1

ExpectErrorMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…