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

Method ExpectPrintName

parse_test.go:32–47  ·  view source on GitHub ↗
(name, input, output string)

Source from the content-addressed store, hash-verified

30}
31
32func (t ParserTestCase) ExpectPrintName(name, input, output string) {
33 set := parseSet
34 if t.set != nil {
35 set = t.set
36 }
37 template, err := set.parse(name, input, false)
38 if err != nil {
39 t.Errorf("%q %s", input, err.Error())
40 return
41 }
42 expected := strings.ReplaceAll(template.String(), "\r\n", "\n")
43 output = strings.ReplaceAll(output, "\r\n", "\n")
44 if expected != output {
45 t.Errorf("Unexpected tree on %s Got:\n%s\nExpected: \n%s\n", name, expected, output)
46 }
47}
48
49func (t ParserTestCase) ExpectPrint(input, output string) {
50 t.ExpectPrintName("", input, output)

Callers 2

ExpectPrintMethod · 0.95
TestPrintFileMethod · 0.95

Calls 2

parseMethod · 0.80
StringMethod · 0.65

Tested by

no test coverage detected