this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

internal/cuetxtar: show ./ prefix in out/errors.txt paths

Remove the strings.ReplaceAll that was stripping "./" from error paths
in the out/errors.txt section. Error messages now show standard
"./in.cue:3:5" style paths, consistent with cue tool output.

Update all out/errors.txt golden sections accordingly.

Signed-off-by: Marcel van Lohuizen <mpvl@gmail.com>
Change-Id: Ic06674907060baa32ee31e405082728bb3bd0189
Reviewed-on: https://cue.gerrithub.io/c/cue-lang/cue/+/1234698
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>

+105 -108
+8 -8
cue/testdata/basicrewrite/003_integer-specific_arithmetic.txtar
··· 28 28 me2: mod(2, 1.0) @test(err, code=eval, pos=[0:13], contains="cannot use") 29 29 -- out/errors.txt -- 30 30 [eval] qe1: cannot use 2.0 (type float) as int in argument 1 to quo: 31 - in.cue:5:10 31 + ./in.cue:5:10 32 32 [eval] qe2: cannot use 1.0 (type float) as int in argument 2 to quo: 33 - in.cue:6:13 33 + ./in.cue:6:13 34 34 [eval] re1: cannot use 2.0 (type float) as int in argument 1 to rem: 35 - in.cue:12:10 35 + ./in.cue:12:10 36 36 [eval] re2: cannot use 1.0 (type float) as int in argument 2 to rem: 37 - in.cue:13:13 37 + ./in.cue:13:13 38 38 [eval] de1: cannot use 2.0 (type float) as int in argument 1 to div: 39 - in.cue:19:10 39 + ./in.cue:19:10 40 40 [eval] de2: cannot use 1.0 (type float) as int in argument 2 to div: 41 - in.cue:20:13 41 + ./in.cue:20:13 42 42 [eval] me1: cannot use 2.0 (type float) as int in argument 1 to mod: 43 - in.cue:26:10 43 + ./in.cue:26:10 44 44 [eval] me2: cannot use 1.0 (type float) as int in argument 2 to mod: 45 - in.cue:27:13 45 + ./in.cue:27:13 46 46 -- out/compile -- 47 47 --- in.cue 48 48 {
+2 -2
cue/testdata/basicrewrite/004_booleans.txtar
··· 7 7 e: !true 8 8 -- out/errors.txt -- 9 9 [eval] e: conflicting values false and true: 10 - in.cue:5:4 11 - in.cue:6:4 10 + ./in.cue:5:4 11 + ./in.cue:6:4 12 12 -- out/compile -- 13 13 --- in.cue 14 14 {
+2 -2
cue/testdata/basicrewrite/005_boolean_arithmetic.txtar
··· 7 7 f: true & false @test(err, code=eval, pos=[0:4 0:11]) 8 8 -- out/errors.txt -- 9 9 [eval] f: conflicting values false and true: 10 - in.cue:6:4 11 - in.cue:6:11 10 + ./in.cue:6:4 11 + ./in.cue:6:11 12 12 -- out/compile -- 13 13 --- in.cue 14 14 {
+2 -2
cue/testdata/basicrewrite/006_basic_type.txtar
··· 9 9 f: bool 10 10 -- out/errors.txt -- 11 11 [eval] d: conflicting values int and float (mismatched types int and float): 12 - in.cue:5:4 13 - in.cue:5:10 12 + ./in.cue:5:4 13 + ./in.cue:5:10 14 14 -- out/compile -- 15 15 --- in.cue 16 16 {
+9 -9
cue/testdata/basicrewrite/010_lists.txtar
··· 11 11 e5: [1, 2, 4, 8] & [1, 2, ...>=4 & <=5] @test(err, code=eval, pos=[0:36 0:15], contains="invalid value") 12 12 -- out/errors.txt -- 13 13 [eval] e: conflicting values [] and 4 (mismatched types list and int): 14 - in.cue:4:4 15 - in.cue:4:9 14 + ./in.cue:4:4 15 + ./in.cue:4:9 16 16 [eval] e2: undefined field: d: 17 - in.cue:7:9 17 + ./in.cue:7:9 18 18 [eval] e3: invalid index -1 (index must be non-negative): 19 - in.cue:8:5 20 - in.cue:8:9 19 + ./in.cue:8:5 20 + ./in.cue:8:9 21 21 [eval] e4.3: invalid value 8 (out of bound <=5): 22 - in.cue:9:21 23 - in.cue:9:38 22 + ./in.cue:9:21 23 + ./in.cue:9:38 24 24 [eval] e5.3: invalid value 8 (out of bound <=5): 25 - in.cue:10:36 26 - in.cue:10:15 25 + ./in.cue:10:36 26 + ./in.cue:10:15 27 27 -- out/compile -- 28 28 --- in.cue 29 29 {
+4 -4
cue/testdata/basicrewrite/012_selecting.txtar
··· 8 8 h: [3].b @test(err, code=eval, pos=[0:8]) 9 9 -- out/errors.txt -- 10 10 [eval] e: index out of range [4] with length 0: 11 - in.cue:4:11 11 + ./in.cue:4:11 12 12 [incomplete] f: undefined field: b: 13 - in.cue:5:11 13 + ./in.cue:5:11 14 14 [incomplete] g: undefined field: b: 15 - in.cue:6:11 15 + ./in.cue:6:11 16 16 [eval] h: undefined field: b: 17 - in.cue:7:8 17 + ./in.cue:7:8 18 18 -- todo.txt -- 19 19 Some error messages could use improvement. Address after query 20 20 extension is implemented.
+2 -2
cue/testdata/basicrewrite/013_obj_unify.txtar
··· 10 10 e: {a: 3} 11 11 -- out/errors.txt -- 12 12 [eval] e: conflicting values 1 and {a:3} (mismatched types int and struct): 13 - in.cue:8:4 14 - in.cue:9:4 13 + ./in.cue:8:4 14 + ./in.cue:9:4 15 15 -- out/compile -- 16 16 --- in.cue 17 17 {
+7 -7
cue/testdata/basicrewrite/015_types.txtar
··· 10 10 m: -false @test(err, code=eval, pos=[0:5], contains="invalid operation") 11 11 -- out/errors.txt -- 12 12 [eval] e: conflicting values int and string (mismatched types int and string): 13 - in.cue:5:5 14 - in.cue:5:11 13 + ./in.cue:5:5 14 + ./in.cue:5:11 15 15 [eval] e2: conflicting values 1 and string (mismatched types int and string): 16 - in.cue:6:5 17 - in.cue:6:9 16 + ./in.cue:6:5 17 + ./in.cue:6:9 18 18 [eval] b: invalid operand int ('!' requires concrete value): 19 - in.cue:7:6 19 + ./in.cue:7:6 20 20 [eval] p: invalid operation +true (+ bool): 21 - in.cue:8:5 21 + ./in.cue:8:5 22 22 [eval] m: invalid operation -false (- bool): 23 - in.cue:9:5 23 + ./in.cue:9:5 24 24 -- out/compile -- 25 25 --- in.cue 26 26 {
+1 -1
cue/testdata/basicrewrite/017_null.txtar
··· 10 10 call: null() @test(err, code=eval, pos=[0:7], contains="cannot call non-function") 11 11 -- out/errors.txt -- 12 12 [eval] call: cannot call non-function null (type null): 13 - in.cue:9:7 13 + ./in.cue:9:7 14 14 -- out/compile -- 15 15 --- in.cue 16 16 {
+4 -4
cue/testdata/comprehensions/else_on_error.txtar
··· 23 23 } 24 24 -- out/errors.txt -- 25 25 [eval] forSourceError: cannot range over "not-a-list" (found string, want list or struct): 26 - in.cue:8:11 26 + ./in.cue:8:11 27 27 [eval] ifConditionError: invalid operands "not" and 1 to '+' (type string and int): 28 - in.cue:13:6 29 - in.cue:13:14 28 + ./in.cue:13:6 29 + ./in.cue:13:14 30 30 [user] explicit error (_|_ literal) in source: 31 - in.cue:18:11 31 + ./in.cue:18:11 32 32 -- out/compile -- 33 33 --- in.cue 34 34 {
+1 -1
cue/testdata/comprehensions/for.txtar
··· 15 15 } 16 16 -- out/errors.txt -- 17 17 [eval] k: cannot range over e (found int, want list or struct): 18 - in.cue:7:14 18 + ./in.cue:7:14 19 19 -- out/eval/stats -- 20 20 Leaks: 2 21 21 Freed: 16
+3 -3
cue/testdata/comprehensions/incomplete.txtar
··· 7 7 c: {for x in top {}} @test(err, code=incomplete, pos=[0:14], contains="cannot range") 8 8 -- out/errors.txt -- 9 9 [incomplete] a: incomplete bool: bool: 10 - in.cue:1:7 10 + ./in.cue:1:7 11 11 [incomplete] b: undefined field: foo: 12 - in.cue:5:18 12 + ./in.cue:5:18 13 13 [incomplete] c: cannot range over top (incomplete type _): 14 - in.cue:6:14 14 + ./in.cue:6:14 15 15 -- out/eval/stats -- 16 16 Leaks: 0 17 17 Freed: 7
+4 -4
cue/testdata/comprehensions/lists.txtar
··· 4 4 b: [for x in a {x}] @test(err, code=eval, pos=[-2:17 -2:21], contains="conflicting values") 5 5 -- out/errors.txt -- 6 6 [eval] a.1.b: conflicting values 3 and 2: 7 - in.cue:1:17 8 - in.cue:1:21 7 + ./in.cue:1:17 8 + ./in.cue:1:21 9 9 [eval] a.1.b: conflicting values 3 and 2: 10 - in.cue:1:17 11 - in.cue:1:21 10 + ./in.cue:1:17 11 + ./in.cue:1:21 12 12 -- out/eval/stats -- 13 13 Leaks: 0 14 14 Freed: 7
+2 -2
cue/testdata/eval/issue962.txtar
··· 14 14 _obj: foo[_what] @test(err, code=incomplete, pos=[-1:8], contains="invalid non-ground value") 15 15 -- out/errors.txt -- 16 16 [incomplete] _obj: invalid non-ground value string (must be concrete string): 17 - in.cue:7:8 17 + ./in.cue:7:8 18 18 [incomplete] _obj: invalid non-ground value string (must be concrete string): 19 - in.cue:7:8 19 + ./in.cue:7:8 20 20 -- out/compile -- 21 21 --- in.cue 22 22 {
+2 -2
cue/testdata/eval/resolve_basic.txtar
··· 10 10 } @test(eq, {x: 5, y: 7}) 11 11 -- out/errors.txt -- 12 12 [incomplete] d.y: non-concrete value _ in operand to +: 13 - in.cue:5:5 14 - in.cue:4:5 13 + ./in.cue:5:5 14 + ./in.cue:4:5 15 15 -- out/eval/stats -- 16 16 Leaks: 0 17 17 Freed: 9
+2 -2
cue/testdata/eval/selectors.txtar
··· 18 18 } @test(eq, {a: {"foo-bar": {c: 3}}, b: 3}) 19 19 -- out/errors.txt -- 20 20 [incomplete] d.y: non-concrete value _ in operand to +: 21 - in.cue:5:5 22 - in.cue:4:5 21 + ./in.cue:5:5 22 + ./in.cue:4:5 23 23 -- out/eval/stats -- 24 24 Leaks: 0 25 25 Freed: 18
+3 -3
cue/testdata/fulleval/005_conditional_field.txtar
··· 25 25 } 26 26 -- out/errors.txt -- 27 27 [incomplete] d: non-concrete value int in operand to >: 28 - in.cue:15:5 29 - in.cue:14:5 30 - in.cue:15:2 28 + ./in.cue:15:5 29 + ./in.cue:14:5 30 + ./in.cue:15:2 31 31 -- out/compile -- 32 32 --- in.cue 33 33 {
+18 -18
cue/testdata/fulleval/021_complex_groundness_2.txtar
··· 24 24 a: b: c: d: string 25 25 -- out/errors.txt -- 26 26 [incomplete] f1.res.s: non-concrete value string in operand to +: 27 - in.cue:5:25 28 - in.cue:3:34 29 - in.cue:5:14 30 - in.cue:6:23 31 - in.cue:7:13 27 + ./in.cue:5:25 28 + ./in.cue:3:34 29 + ./in.cue:5:14 30 + ./in.cue:6:23 31 + ./in.cue:7:13 32 32 f1.res.s: non-concrete value string in operand to +: 33 - in.cue:6:34 34 - in.cue:3:34 35 - in.cue:5:14 36 - in.cue:6:23 37 - in.cue:7:13 33 + ./in.cue:6:34 34 + ./in.cue:3:34 35 + ./in.cue:5:14 36 + ./in.cue:6:23 37 + ./in.cue:7:13 38 38 [incomplete] a.b.c.s: non-concrete value string in operand to +: 39 - in.cue:5:25 40 - in.cue:5:14 41 - in.cue:6:23 42 - in.cue:7:13 39 + ./in.cue:5:25 40 + ./in.cue:5:14 41 + ./in.cue:6:23 42 + ./in.cue:7:13 43 43 a.b.c.s: non-concrete value string in operand to +: 44 - in.cue:6:34 45 - in.cue:5:14 46 - in.cue:6:23 47 - in.cue:7:13 44 + ./in.cue:6:34 45 + ./in.cue:5:14 46 + ./in.cue:6:23 47 + ./in.cue:7:13 48 48 -- out/compile -- 49 49 --- in.cue 50 50 {
+4 -4
cue/testdata/fulleval/044_Issue_#178.txtar
··· 17 17 bar: hex.EncodedLen(len) @test(err, code=incomplete) 18 18 -- out/errors.txt -- 19 19 [incomplete] foo: error in call to encoding/csv.Decode: non-concrete value bytes: 20 - in.cue:5:7 21 - in.cue:6:7 20 + ./in.cue:5:7 21 + ./in.cue:6:7 22 22 [incomplete] bar: error in call to encoding/hex.EncodedLen: non-concrete value int: 23 - in.cue:9:6 24 - in.cue:8:6 23 + ./in.cue:9:6 24 + ./in.cue:8:6 25 25 -- out/eval/stats -- 26 26 Leaks: 0 27 27 Freed: 5
+1 -1
cue/testdata/fulleval/048_dont_pass_incomplete_values_to_builtins.txtar
··· 7 7 foo: json.Marshal(input) @test(err, code=incomplete) 8 8 -- out/errors.txt -- 9 9 [incomplete] foo: error in call to encoding/json.Marshal: non-concrete argument 0: 10 - in.cue:4:8 10 + ./in.cue:4:8 11 11 -- out/eval/stats -- 12 12 Leaks: 0 13 13 Freed: 3
+5 -5
cue/testdata/fulleval/050_json_Marshaling_detects_incomplete.txtar
··· 12 12 b: json.Marshal(foo) @test(err, code=incomplete) 13 13 -- out/errors.txt -- 14 14 [incomplete] a: error in call to encoding/json.Marshal: cannot convert incomplete value "string" to JSON: 15 - in.cue:3:4 16 - in.cue:3:21 15 + ./in.cue:3:4 16 + ./in.cue:3:21 17 17 [incomplete] foo.b: undefined field: c: 18 - in.cue:7:9 18 + ./in.cue:7:9 19 19 [incomplete] b: error in call to encoding/json.Marshal: undefined field: c: 20 - in.cue:9:4 21 - in.cue:7:9 20 + ./in.cue:9:4 21 + ./in.cue:7:9 22 22 -- out/eval/stats -- 23 23 Leaks: 0 24 24 Freed: 16
+4 -4
cue/testdata/fulleval/051_detectIncompleteYAML.txtar
··· 27 27 }) 28 28 -- out/errors.txt -- 29 29 [incomplete] #Spec.data.baz: error in call to encoding/yaml.Marshal: non-concrete argument 0: 30 - in.cue:11:11 30 + ./in.cue:11:11 31 31 [incomplete] #Spec.data.foobar: error in call to encoding/yaml.Marshal: incomplete value string: 32 - in.cue:12:11 33 - in.cue:6:21 34 - in.cue:9:9 32 + ./in.cue:12:11 33 + ./in.cue:6:21 34 + ./in.cue:9:9 35 35 -- out/eval/stats -- 36 36 Leaks: 0 37 37 Freed: 17
+3 -3
cue/testdata/fulleval/052_detectIncompleteJSON.txtar
··· 27 27 }) 28 28 -- out/errors.txt -- 29 29 [incomplete] #Spec.data.baz: error in call to encoding/json.Marshal: non-concrete argument 0: 30 - in.cue:11:11 30 + ./in.cue:11:11 31 31 [incomplete] #Spec.data.foobar: error in call to encoding/json.Marshal: cannot convert incomplete value "string" to JSON: 32 - in.cue:12:11 33 - in.cue:6:21 32 + ./in.cue:12:11 33 + ./in.cue:6:21 34 34 -- out/eval/stats -- 35 35 Leaks: 0 36 36 Freed: 17
+5 -5
cue/testdata/fulleval/055_issue318.txtar
··· 15 15 } 16 16 -- out/errors.txt -- 17 17 [eval] #T.out1: invalid interpolation: undefined field: y: 18 - in.cue:3:8 19 - in.cue:3:24 18 + ./in.cue:3:8 19 + ./in.cue:3:24 20 20 [eval] #T.out2: invalid interpolation: undefined field: y: 21 - in.cue:4:8 22 - in.cue:4:15 21 + ./in.cue:4:8 22 + ./in.cue:4:15 23 23 [eval] #T.vy: undefined field: y: 24 - in.cue:6:12 24 + ./in.cue:6:12 25 25 -- out/compile -- 26 26 --- in.cue 27 27 {
+2 -2
cue/testdata/interpolation/incomplete.txtar
··· 16 16 """ @test(err, code=incomplete) 17 17 -- out/errors.txt -- 18 18 [incomplete] out: invalid interpolation: undefined field: #d: 19 - in.cue:8:6 20 - in.cue:13:18 19 + ./in.cue:8:6 20 + ./in.cue:13:18 21 21 -- out/eval/stats -- 22 22 Leaks: 0 23 23 Freed: 7
+3 -3
cue/testdata/interpolation/issue487.txtar
··· 15 15 } 16 16 -- out/errors.txt -- 17 17 [incomplete] t1.#R.name: invalid interpolation: non-concrete value >=0 & int (type int): 18 - in.cue:4:9 18 + ./in.cue:4:9 19 19 [incomplete] t2.#R.name: invalid interpolation: non-concrete value string (type string): 20 - in.cue:11:9 21 - in.cue:10:9 20 + ./in.cue:11:9 21 + ./in.cue:10:9 22 22 -- out/eval/stats -- 23 23 Leaks: 0 24 24 Freed: 15
+2 -2
cue/testdata/references/optional.txtar
··· 11 11 } 12 12 -- out/errors.txt -- 13 13 [incomplete] t1.a.b: cannot reference optional field: foo: 14 - in.cue:4:5 14 + ./in.cue:4:5 15 15 [incomplete] t2.a.b: cannot reference optional field: foo: 16 - in.cue:7:5 16 + ./in.cue:7:5 17 17 -- out/eval/stats -- 18 18 Leaks: 0 19 19 Freed: 9
-3
internal/cuetxtar/inline.go
··· 880 880 }) 881 881 } 882 882 result := buf.String() 883 - // TODO: consider removing this line to have standard errors. But keep now 884 - // to minimize diffs in this CL. 885 - result = strings.ReplaceAll(result, "./", "") 886 883 if result != "" && result[len(result)-1] != '\n' { 887 884 result += "\n" 888 885 }