cue: add test for filling empty path
Change-Id: Ib38fc0e08453931c80b41b11e1308ede58b38cdb
Reviewed-on: https://cue-review.googlesource.com/c/cue/+/9385
Reviewed-by: CUE cueckoo <cueckoo@gmail.com>
Reviewed-by: Paul Jolly <paul@myitcv.org.uk>
diff --git a/cue/types_test.go b/cue/types_test.go
index d74aafd..1053cd8 100644
--- a/cue/types_test.go
+++ b/cue/types_test.go
@@ -1129,6 +1129,14 @@
out: `
{foo: {x: 1, bar: baz: 1}}
`,
+ }, {
+ // empty path
+ in: `
+ _
+ #foo: 1
+ `,
+ x: ast.NewIdent("#foo"),
+ out: `{1, #foo: 1}`,
}}
for _, tc := range testCases {