(t *testing.T)
| 16 | var _ = fmt.Sprintf |
| 17 | |
| 18 | func TestParserDocSetEmpty(t *testing.T) { |
| 19 | const data = "" |
| 20 | |
| 21 | parsedVal, err := yamlmeta.NewParser(yamlmeta.ParserOpts{WithoutComments: false}).ParseBytes([]byte(data), "") |
| 22 | if err != nil { |
| 23 | t.Fatalf("error: %s", err) |
| 24 | } |
| 25 | |
| 26 | expectedVal := yamlmeta.NewDocumentSet(&yamlmeta.DocumentSetProto{ |
| 27 | Items: []*yamlmeta.DocumentProto{ |
| 28 | &yamlmeta.DocumentProto{ |
| 29 | Position: filepos.NewPosition(1), |
| 30 | }, |
| 31 | }, |
| 32 | Position: filepos.NewUnknownPosition(), |
| 33 | }) |
| 34 | |
| 35 | printer := yamlmeta.NewPrinterWithOpts(nil, yamlmeta.PrinterOpts{ExcludeRefs: true}) |
| 36 | |
| 37 | parsedValStr := printer.PrintStr(parsedVal) |
| 38 | expectedValStr := printer.PrintStr(expectedVal) |
| 39 | |
| 40 | assertEqual(t, parsedValStr, expectedValStr) |
| 41 | } |
| 42 | |
| 43 | func TestParserDocSetNewline(t *testing.T) { |
| 44 | const data = "\n" |
nothing calls this directly
no test coverage detected
searching dependent graphs…