···6262 `16`,
6363 }, {
6464 test("encoding/yaml", `yaml.Validate("a: 2\n---\na: 4", {a:<3})`),
6565- `_|_(error in call to encoding/yaml.Validate: a: invalid value 4 (out of bound <3) (and 1 more errors))`,
6565+ `_|_(error in call to encoding/yaml.Validate: a: invalid value 4 (out of bound <3))`,
6666 }, {
6767 test("encoding/yaml", `yaml.Validate("a: 2\n---\na: 4", {a:<5})`),
6868 `true`,
6969 }, {
7070 test("encoding/yaml", `yaml.Validate("a: 2\n", {a:<5, b:int})`),
7171- `_|_(error in call to encoding/yaml.Validate: b: incomplete value int (and 1 more errors))`,
7171+ `_|_(error in call to encoding/yaml.Validate: b: incomplete value int)`,
7272 }, {
7373 test("strconv", `strconv.FormatUint(64, 16)`),
7474 `"40"`,
···7777 `"foo"`,
7878 }, {
7979 test("regexp", `regexp.Find(#"f\w\w"#, "bar")`),
8080- `_|_(error in call to regexp.Find: no match (and 1 more errors))`,
8080+ `_|_(error in call to regexp.Find: no match)`,
8181 }, {
8282 testExpr(`len([1, 2, 3])`),
8383 `3`,
···9292 x: int
9393 y: json.Marshal({a: x})
9494 }`),
9595- `{x:int,y:_|_(cannot convert incomplete value "int" to JSON (and 1 more errors))}`,
9595+ `{x:int,y:_|_(cannot convert incomplete value "int" to JSON)}`,
9696 }, {
9797 test("encoding/yaml", `yaml.MarshalStream([{a: 1}, {b: 2}])`),
9898 `"a: 1\n---\nb: 2\n"`,
···146146 emit string
147147 }{{
148148 test("list", `list.Sort([{a:1}, {b:2}], list.Ascending)`),
149149- `_|_(error in call to list.Sort: less: invalid operands {b:2} and {a:1} to '<' (type struct and struct) (and 1 more errors))`,
149149+ `_|_(error in call to list.Sort: less: invalid operands {b:2} and {a:1} to '<' (type struct and struct))`,
150150 }}
151151 for i, tc := range testCases {
152152 t.Run(fmt.Sprint(i), func(t *testing.T) {
+3-1
internal/core/adt/context.go
···591591 bb.Err = errors.Wrapf(b.Err, c.src.Pos(), "")
592592 result = &bb
593593 }
594594- c.errs = CombineErrors(c.src, c.errs, result)
594594+ if c.errs != result {
595595+ c.errs = CombineErrors(c.src, c.errs, result)
596596+ }
595597 }
596598 if c.errs != nil {
597599 result = c.errs
+2-2
pkg/encoding/base64/testdata/gen.txtar
···1515Result:
1616t1: "Zm9v"
1717t2: 'foo'
1818-t3: _|_ // error in call to encoding/base64.Decode: illegal base64 data at input byte 0 (and 1 more errors)
1919-t4: _|_ // error in call to encoding/base64.Decode: base64: unsupported encoding: cannot use value {} (type struct) as null (and 1 more errors)
1818+t3: _|_ // error in call to encoding/base64.Decode: illegal base64 data at input byte 0
1919+t4: _|_ // error in call to encoding/base64.Decode: base64: unsupported encoding: cannot use value {} (type struct) as null
2020
+1-1
pkg/encoding/hex/testdata/gen.txtar
···1414Result:
1515t1: "666f6f"
1616t2: 'foo'
1717-t3: _|_ // error in call to encoding/hex.Decode: encoding/hex: invalid byte: U+006F 'o' (and 1 more errors)
1717+t3: _|_ // error in call to encoding/hex.Decode: encoding/hex: invalid byte: U+006F 'o'
1818t4: """
1919 00000000 66 6f 6f |foo|
2020
+1-1
pkg/encoding/json/testdata/gen.txtar
···2525import "encoding/json"
26262727t1: true
2828-t2: _|_ // error in call to encoding/json.Validate: a: invalid value 10 (out of bound <3) (and 1 more errors)
2828+t2: _|_ // error in call to encoding/json.Validate: a: invalid value 10 (out of bound <3)
2929t3: true
3030t4: "[1,2]"
3131t5: """
+3-3
pkg/encoding/yaml/testdata/gen.txtar
···2323 yaml.ValidatePartial:3:5
24242525Result:
2626-t1: _|_ // error in call to encoding/yaml.Validate: a: invalid value 4 (out of bound <3) (and 1 more errors)
2626+t1: _|_ // error in call to encoding/yaml.Validate: a: invalid value 4 (out of bound <3)
2727t2: true
2828-t3: _|_ // error in call to encoding/yaml.Validate: b: incomplete value int (and 1 more errors)
2929-t4: _|_ // error in call to encoding/yaml.ValidatePartial: a: invalid value 4 (out of bound <3) (and 1 more errors)
2828+t3: _|_ // error in call to encoding/yaml.Validate: b: incomplete value int
2929+t4: _|_ // error in call to encoding/yaml.ValidatePartial: a: invalid value 4 (out of bound <3)
3030t5: true
3131t6: true
3232t7: """
+19-19
pkg/list/testdata/gen.txtar
···7979 ./in.cue:46:24
8080 list:10:9
8181Ascending.x: error in call to list.Sort: conflicting values string and {b:2} (mismatched types string and struct):
8282- ./in.cue:46:24
8282+ ./in.cue:60:24
8383 list:10:18
8484Ascending.y: error in call to list.Sort: 2 errors in empty disjunction:
8585Ascending.y: error in call to list.Sort: conflicting values number and {a:1} (mismatched types number and struct):
8686- ./in.cue:46:17
8686+ ./in.cue:60:17
8787 list:10:9
8888Ascending.y: error in call to list.Sort: conflicting values string and {a:1} (mismatched types string and struct):
8989- ./in.cue:60:17
8989+ ./in.cue:46:17
9090 list:10:18
9191t3: cannot use "foo" (type string) as list in argument 1 to list.Avg:
9292 ./in.cue:5:14
···107107108108Result:
109109t1: 2.5
110110-t2: _|_ // error in call to list.Avg: empty list (and 1 more errors)
110110+t2: _|_ // error in call to list.Avg: empty list
111111t3: _|_ // t3: cannot use "foo" (type string) as list in argument 1 to list.Avg
112112t4: [1, 2, 3, 4]
113113t5: [3, 4]
114114t6: []
115115-t7: _|_ // error in call to list.Drop: negative index (and 1 more errors)
115115+t7: _|_ // error in call to list.Drop: negative index
116116t8: [1, 2, 3, 4]
117117t9: [1, [[2, 3], []], [4]]
118118t10: [1, [2, 3], [], 4]
119119t11: [1, 2, 3, 4]
120120t12: []
121121-t13: _|_ // error in call to list.FlattenN: cannot use value "foo" (type string) as list (and 1 more errors)
121121+t13: _|_ // error in call to list.FlattenN: cannot use value "foo" (type string) as list
122122t14: _|_ // t14: cannot use "foo" (type string) as int in argument 2 to list.FlattenN
123123t15: 4
124124-t16: _|_ // error in call to list.Max: empty list (and 1 more errors)
124124+t16: _|_ // error in call to list.Max: empty list
125125t17: _|_ // t17: cannot use "foo" (type string) as list in argument 1 to list.Max
126126t18: 1
127127-t19: _|_ // error in call to list.Min: empty list (and 1 more errors)
127127+t19: _|_ // error in call to list.Min: empty list
128128t20: _|_ // t20: cannot use "foo" (type string) as list in argument 1 to list.Min
129129t21: 24
130130t22: 1
131131t23: _|_ // t23: cannot use "foo" (type string) as list in argument 1 to list.Product
132132-t24: _|_ // error in call to list.Range: step must be non zero (and 1 more errors)
133133-t25: _|_ // error in call to list.Range: end must be greater than start when step is positive (and 1 more errors)
134134-t26: _|_ // error in call to list.Range: end must be less than start when step is negative (and 1 more errors)
132132+t24: _|_ // error in call to list.Range: step must be non zero
133133+t25: _|_ // error in call to list.Range: end must be greater than start when step is positive
134134+t26: _|_ // error in call to list.Range: end must be less than start when step is negative
135135t27: [0, 1, 2, 3, 4]
136136t28: [0]
137137t29: [0, 2, 4]
138138t30: [5, 4, 3, 2, 1]
139139t31: [0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5]
140140t32: [2, 3]
141141-t33: _|_ // error in call to list.Slice: negative index (and 1 more errors)
142142-t34: _|_ // error in call to list.Slice: invalid index: 3 > 1 (and 1 more errors)
143143-t35: _|_ // error in call to list.Slice: slice bounds out of range (and 1 more errors)
144144-t36: _|_ // error in call to list.Slice: slice bounds out of range (and 1 more errors)
141141+t33: _|_ // error in call to list.Slice: negative index
142142+t34: _|_ // error in call to list.Slice: invalid index: 3 > 1
143143+t35: _|_ // error in call to list.Slice: slice bounds out of range
144144+t36: _|_ // error in call to list.Slice: slice bounds out of range
145145t37: []
146146t38: [1, 2, 3, 4]
147147t39: [{
···154154 a: 2
155155 v: 1
156156}]
157157-t40: _|_ // error in call to list.Sort: Ascending.x: 2 errors in empty disjunction: (and 11 more errors)
157157+t40: _|_ // error in call to list.Sort: Ascending.x: 2 errors in empty disjunction: (and 5 more errors)
158158t41: ["a", "b"]
159159-t42: _|_ // t42: invalid type element 0 (int) of string list argument 0 (and 1 more errors)
159159+t42: _|_ // t42: invalid type element 0 (int) of string list argument 0
160160t43: 10
161161t44: 0
162162t45: _|_ // t45: cannot use "foo" (type string) as list in argument 1 to list.Sum
163163t46: []
164164t47: [1, 2]
165165t48: [1, 2, 3, 4]
166166-t49: _|_ // error in call to list.Take: negative index (and 1 more errors)
166166+t49: _|_ // error in call to list.Take: negative index
167167t50: true
168168t51: false
169169t52: true
170170t53: false
171171-t54: _|_ // error in call to list.Sort: Ascending.x: 2 errors in empty disjunction: (and 11 more errors)
171171+t54: _|_ // error in call to list.Sort: Ascending.x: 2 errors in empty disjunction: (and 5 more errors)
172172
+2-2
pkg/list/testdata/list.txtar
···8989 t8: {
9090 x: [1]
9191 n: -1
9292- v: _|_ // error in call to list.Repeat: negative count (and 1 more errors)
9292+ v: _|_ // error in call to list.Repeat: negative count
9393 }
9494}
9595concat: {
···123123 }
124124 t8: {
125125 x: [1, [2]]
126126- v: _|_ // error in call to list.Concat: cannot use value 1 (type int) as list (and 1 more errors)
126126+ v: _|_ // error in call to list.Concat: cannot use value 1 (type int) as list
127127 }
128128}
129129unique: {
+2-2
pkg/math/testdata/gen.txtar
···3636t1: 3.14159265358979323846264338327950288419716939937510582097494459
3737t2: 3
3838t3: _|_ // t3: cannot call non-function math.Pi (type float)
3939-t6: _|_ // error in call to math.Jacobi: big: invalid 2nd argument to Int.Jacobi: need odd integer but got 2000 (and 1 more errors)
3939+t6: _|_ // error in call to math.Jacobi: big: invalid 2nd argument to Int.Jacobi: need odd integer but got 2000
4040t7: 1
4141-t8: _|_ // cannot use 2.0E+400 (type float) as float64 in argument 0 to math.Asin: value was rounded up (and 1 more errors)
4141+t8: _|_ // cannot use 2.0E+400 (type float) as float64 in argument 0 to math.Asin: value was rounded up
4242t16: 4096
4343t17: 1e+4
4444t18: true
+1-1
pkg/math/testdata/round.txtar
···4444mul0: true
4545mul1: false
4646// TODO(errors): ensure path is included for the following error.
4747-mul2: _|_ // error in call to math.MultipleOf: division by zero (and 1 more errors)
4747+mul2: _|_ // error in call to math.MultipleOf: division by zero
4848mul3: false
4949mul4: true
5050mul5: true
+1-1
pkg/net/testdata/gen.txtar
···3636t4: "example.com:80"
3737t5: "[2001:db8::1]:80"
3838t6: "192.30.4.2:80"
3939-t7: _|_ // error in call to net.JoinHostPort: invalid host [192, 30, 4] (and 1 more errors)
3939+t7: _|_ // error in call to net.JoinHostPort: invalid host [192, 30, 4]
4040t8: true
4141t9: _|_ // t9: invalid value "23.23.23.2333" (does not satisfy net.IPv4)
4242t10: true
···28282929Result:
3030t1: "foo"
3131-t2: _|_ // error in call to regexp.Find: no match (and 1 more errors)
3131+t2: _|_ // error in call to regexp.Find: no match
3232t3: ["foo", "flo"]
3333t4: ["foo", "flo"]
3434-t5: _|_ // error in call to regexp.FindAll: no match (and 1 more errors)
3434+t5: _|_ // error in call to regexp.FindAll: no match
3535t6: ["flo", "l", "o"]
3636t7: [["flo", "l", "o"], ["foo", "o", "o"], ["fro", "r", "o"]]
3737-t8: _|_ // error in call to regexp.FindAllSubmatch: no match (and 1 more errors)
3737+t8: _|_ // error in call to regexp.FindAllSubmatch: no match
3838t9: {
3939 A: "l"
4040 B: "o"
···5252t11: [{
5353 A: ""
5454}]
5555-t12: _|_ // error in call to regexp.FindAllNamedSubmatch: no match (and 1 more errors)
5555+t12: _|_ // error in call to regexp.FindAllNamedSubmatch: no match
5656t13: "valid"
5757t14: _|_ // t14: invalid value "invalid)" (does not satisfy regexp.Valid): error in call to regexp.Valid: error parsing regexp: unexpected ): `invalid)`
5858
+2-2
pkg/strconv/testdata/gen.txtar
···19192020Result:
2121t1: "40"
2222-t2: _|_ // int 300 overflows byte in argument 1 in call to strconv.FormatFloat (and 1 more errors)
2323-t3: _|_ // cannot use -1 (type int) as byte in argument 1 to strconv.FormatFloat (and 1 more errors)
2222+t2: _|_ // int 300 overflows byte in argument 1 in call to strconv.FormatFloat
2323+t3: _|_ // cannot use -1 (type int) as byte in argument 1 to strconv.FormatFloat
2424t4: _|_ // t4: cannot use 1.0 (type float) as int in argument 2 to strconv.FormatFloat
2525t5: "true"
2626
+1-1
pkg/strings/testdata/gen.txtar
···43434444Result:
4545t1: "Hello World!"
4646-t2: _|_ // t2: invalid type element 0 (int) of string list argument 0 (and 1 more errors)
4646+t2: _|_ // t2: invalid type element 0 (int) of string list argument 0
4747t3: 97
4848t4: 'llo'
4949t5: "✓ H"