blob: df4bd4fda4269acfce5ed59149abdd52cdc79b00 [file] [log] [blame]
cue trim -o - ./trim
cmp stdout expect-stdout
-- expect-stdout --
package trim
foo: <Name>: {
_value: string
a: 4
b: string
d: 8
e: "foo"
f: ">> \( _value) <<"
n: 5
list: ["foo", 8.0]
struct: {a: 3.0}
sList: [{a: 8, b: string}, {a: 9, b: *"foo" | string}]
rList: [{a: "a"}]
rcList: [{a: "a", c: b}]
t: <Name>: {
x: >=0 & <=5
}
}
foo: bar: {
_value: "here"
b: "foo"
c: 45
sList: [{b: "foo"}, {}]
}
foo: baz: {}
foo: multipath: {
t: <Name>: {
// Combined with the other template, we know the value must be 5 and
// thus the entry below can be eliminated.
x: >=5 & <=8
}
t: u: {
}
}
// TODO: top-level fields are currently not removed.
group: {
for k, v in foo {
comp: "\(k)": v
}
comp: bar: {
aa: 8 // new value
}
}
-- trim/trim.cue --
package trim
foo: <Name>: {
_value: string
a: 4
b: string
d: 8
e: "foo"
f: ">> \( _value) <<"
n: 5
list: ["foo", 8.0]
struct: {a: 3.0}
sList: [{a: 8, b: string}, {a: 9, b: *"foo" | string}]
rList: [{a: "a"}]
rcList: [{a: "a", c: b}]
t: <Name>: {
x: >=0 & <=5
}
}
foo: bar: {
_value: "here"
b: "foo"
c: 45
sList: [{b: "foo"}, {}]
}
foo: baz: {}
foo: multipath: {
t: <Name>: {
// Combined with the other template, we know the value must be 5 and
// thus the entry below can be eliminated.
x: >=5 & <=8
}
t: u: {
}
}
// TODO: top-level fields are currently not removed.
group: {
for k, v in foo {
comp: "\(k)": v
}
comp: bar: {
aa: 8 // new value
}
}
-- cue.mod --