Skip to content

Commit 947d33f

Browse files
committed
internal/core/adt: add tests for issue 3801
Issue #3801 Signed-off-by: Marcel van Lohuizen <[email protected]> Change-Id: Ia0b24e3b7585b9b03bf9a89917c5dc31333cf803 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1211646 Reviewed-by: Daniel Martí <[email protected]> Unity-Result: CUE porcuepine <[email protected]> TryBot-Result: CUEcueckoo <[email protected]>
1 parent c0356be commit 947d33f

File tree

2 files changed

+995
-31
lines changed

2 files changed

+995
-31
lines changed

cue/testdata/definitions/typocheck.txtar

+30-31
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ embed: openValidator: t2: {
9797
a: X
9898
a: b: 1
9999
}
100-
101100
disjunction: withErr: t1: {
102101
params: {}
103102
out: #Schema1 & {
@@ -229,8 +228,8 @@ and.transitive.out.ok: field not allowed:
229228
and.transitiveWithEmbed.out.ok: field not allowed:
230229
./in.cue:46:3
231230
disjunction.withErr.t1.out.b1: field not allowed:
232-
./validators.cue:30:3
233-
./validators.cue:32:12
231+
./validators.cue:29:3
232+
./validators.cue:31:12
234233
embed.andEmbed.d.err: field not allowed:
235234
./in.cue:31:11
236235
embed.andInStruct.a.err: field not allowed:
@@ -747,14 +746,14 @@ Result:
747746
// [eval]
748747
b1: (_|_){
749748
// [eval] disjunction.withErr.t1.out.b1: field not allowed:
750-
// ./validators.cue:30:3
751-
// ./validators.cue:32:12
749+
// ./validators.cue:29:3
750+
// ./validators.cue:31:12
752751
b2: (_|_){
753752
// [eval] disjunction.withErr.t1.out.b1.b2: field not allowed:
754-
// ./validators.cue:30:7
753+
// ./validators.cue:29:7
755754
b3: (_|_){
756755
// [eval] disjunction.withErr.t1.out.b1.b2.b3: field not allowed:
757-
// ./validators.cue:30:11
756+
// ./validators.cue:29:11
758757
}
759758
}
760759
}
@@ -797,8 +796,8 @@ diff old new
797796
- ./in.cue:45:7
798797
./in.cue:46:3
799798
+disjunction.withErr.t1.out.b1: field not allowed:
800-
+ ./validators.cue:30:3
801-
+ ./validators.cue:32:12
799+
+ ./validators.cue:29:3
800+
+ ./validators.cue:31:12
802801
embed.andEmbed.d.err: field not allowed:
803802
- ./in.cue:28:6
804803
- ./in.cue:29:6
@@ -1397,31 +1396,31 @@ diff old new
13971396
b1: (_|_){
13981397
- // [incomplete] disjunction.withErr.t1.out.b1: 4 errors in empty disjunction:
13991398
- // disjunction.withErr.t1.out.b1: conflicting values null and {b2:{b3:params.mayExistLater}} (mismatched types null and struct):
1400-
- // ./validators.cue:30:7
1401-
- // ./validators.cue:32:17
1399+
- // ./validators.cue:29:7
1400+
- // ./validators.cue:31:17
14021401
- // disjunction.withErr.t1.out.b1.b2: 2 errors in empty disjunction:
14031402
- // disjunction.withErr.t1.out.b1.b2: conflicting values null and {b3:params.mayExistLater} (mismatched types null and struct):
1404-
- // ./validators.cue:30:11
1405-
- // ./validators.cue:33:17
1403+
- // ./validators.cue:29:11
1404+
- // ./validators.cue:32:17
14061405
- // disjunction.withErr.t1.out.b1.b2.b3: undefined field: mayExistLater:
1407-
- // ./validators.cue:30:22
1406+
- // ./validators.cue:29:22
14081407
+ // [eval] disjunction.withErr.t1.out.b1: field not allowed:
1409-
+ // ./validators.cue:30:3
1410-
+ // ./validators.cue:32:12
1408+
+ // ./validators.cue:29:3
1409+
+ // ./validators.cue:31:12
14111410
b2: (_|_){
14121411
- // [incomplete] disjunction.withErr.t1.out.b1.b2: 2 errors in empty disjunction:
14131412
- // disjunction.withErr.t1.out.b1.b2: conflicting values null and {b3:params.mayExistLater} (mismatched types null and struct):
1414-
- // ./validators.cue:30:11
1415-
- // ./validators.cue:33:17
1413+
- // ./validators.cue:29:11
1414+
- // ./validators.cue:32:17
14161415
- // disjunction.withErr.t1.out.b1.b2.b3: undefined field: mayExistLater:
1417-
- // ./validators.cue:30:22
1416+
- // ./validators.cue:29:22
14181417
+ // [eval] disjunction.withErr.t1.out.b1.b2: field not allowed:
1419-
+ // ./validators.cue:30:7
1418+
+ // ./validators.cue:29:7
14201419
b3: (_|_){
14211420
- // [incomplete] disjunction.withErr.t1.out.b1.b2.b3: undefined field: mayExistLater:
1422-
- // ./validators.cue:30:22
1421+
- // ./validators.cue:29:22
14231422
+ // [eval] disjunction.withErr.t1.out.b1.b2.b3: field not allowed:
1424-
+ // ./validators.cue:30:11
1423+
+ // ./validators.cue:29:11
14251424
}
14261425
}
14271426
}
@@ -2049,24 +2048,24 @@ Result:
20492048
b1: (_|_){
20502049
// [incomplete] disjunction.withErr.t1.out.b1: 4 errors in empty disjunction:
20512050
// disjunction.withErr.t1.out.b1: conflicting values null and {b2:{b3:params.mayExistLater}} (mismatched types null and struct):
2052-
// ./validators.cue:30:7
2053-
// ./validators.cue:32:17
2051+
// ./validators.cue:29:7
2052+
// ./validators.cue:31:17
20542053
// disjunction.withErr.t1.out.b1.b2: 2 errors in empty disjunction:
20552054
// disjunction.withErr.t1.out.b1.b2: conflicting values null and {b3:params.mayExistLater} (mismatched types null and struct):
2056-
// ./validators.cue:30:11
2057-
// ./validators.cue:33:17
2055+
// ./validators.cue:29:11
2056+
// ./validators.cue:32:17
20582057
// disjunction.withErr.t1.out.b1.b2.b3: undefined field: mayExistLater:
2059-
// ./validators.cue:30:22
2058+
// ./validators.cue:29:22
20602059
b2: (_|_){
20612060
// [incomplete] disjunction.withErr.t1.out.b1.b2: 2 errors in empty disjunction:
20622061
// disjunction.withErr.t1.out.b1.b2: conflicting values null and {b3:params.mayExistLater} (mismatched types null and struct):
2063-
// ./validators.cue:30:11
2064-
// ./validators.cue:33:17
2062+
// ./validators.cue:29:11
2063+
// ./validators.cue:32:17
20652064
// disjunction.withErr.t1.out.b1.b2.b3: undefined field: mayExistLater:
2066-
// ./validators.cue:30:22
2065+
// ./validators.cue:29:22
20672066
b3: (_|_){
20682067
// [incomplete] disjunction.withErr.t1.out.b1.b2.b3: undefined field: mayExistLater:
2069-
// ./validators.cue:30:22
2068+
// ./validators.cue:29:22
20702069
}
20712070
}
20722071
}

0 commit comments

Comments
 (0)