(t *testing.T)
| 236 | } |
| 237 | |
| 238 | func TestParserRootString(t *testing.T) { |
| 239 | expectedVal := yamlmeta.NewDocumentSet(&yamlmeta.DocumentSetProto{ |
| 240 | Items: []*yamlmeta.DocumentProto{ |
| 241 | &yamlmeta.DocumentProto{ |
| 242 | Comments: []*yamlmeta.CommentProto{ |
| 243 | &yamlmeta.CommentProto{Data: " comment", Position: filepos.NewPosition(1)}, |
| 244 | }, |
| 245 | Value: "abc", |
| 246 | Position: filepos.NewPosition(1), |
| 247 | }, |
| 248 | }, |
| 249 | Position: filepos.NewUnknownPosition(), |
| 250 | }) |
| 251 | |
| 252 | parserExamples{ |
| 253 | // TODO should really be owned by abc |
| 254 | {Description: "single line", Data: "--- abc # comment", Expected: expectedVal}, |
| 255 | {Description: "common on doc", Data: "--- # comment\nabc", Expected: expectedVal}, |
| 256 | // TODO add *yamlmeta.Value |
| 257 | // {"comment on value", "---\nabc # comment", expectedVal}, |
| 258 | }.Check(t) |
| 259 | } |
| 260 | |
| 261 | func TestParserMapArray(t *testing.T) { |
| 262 | const data = `--- |
nothing calls this directly
no test coverage detected
searching dependent graphs…