MCPcopy
hub / github.com/carvel-dev/ytt / TestParserRootString

Function TestParserRootString

pkg/yamlmeta/parser_test.go:238–259  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

236}
237
238func 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
261func TestParserMapArray(t *testing.T) {
262 const data = `---

Callers

nothing calls this directly

Calls 4

NewDocumentSetFunction · 0.92
NewPositionFunction · 0.92
NewUnknownPositionFunction · 0.92
CheckMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…