(name, input, output string)
| 30 | } |
| 31 | |
| 32 | func (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 | |
| 49 | func (t ParserTestCase) ExpectPrint(input, output string) { |
| 50 | t.ExpectPrintName("", input, output) |
no test coverage detected