Skip to content

Commit 6dc2f16

Browse files
jnthntatumcopybara-github
authored andcommitted
Update baseline tests for java checker:
- use unique overload_ids - fix file with typo PiperOrigin-RevId: 686195856
1 parent 1021e70 commit 6dc2f16

File tree

5 files changed

+24
-24
lines changed

5 files changed

+24
-24
lines changed

checker/src/test/java/dev/cel/checker/ExprCheckerTest.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -805,13 +805,13 @@ public void abstractTypeParameterized() throws Exception {
805805
"vector",
806806
// Declare the function 'vector' to create the abstract type.
807807
globalOverload(
808-
"vector",
808+
"vector_type",
809809
ImmutableList.of(CelTypes.create(typeParam)),
810810
ImmutableList.of("T"),
811811
CelTypes.create(abstractType)),
812812
// Declare a function to create a new value of abstract type based on a list.
813813
globalOverload(
814-
"vector",
814+
"vector_list",
815815
ImmutableList.of(createList(typeParam)),
816816
ImmutableList.of("T"),
817817
abstractType));
@@ -820,7 +820,7 @@ public void abstractTypeParameterized() throws Exception {
820820
declareFunction(
821821
"at",
822822
memberOverload(
823-
"at",
823+
"vector_at_int",
824824
ImmutableList.of(abstractType, CelTypes.INT64),
825825
ImmutableList.of("T"),
826826
typeParam));
@@ -843,13 +843,13 @@ public void abstractTypeParameterizedInListLiteral() throws Exception {
843843
"vector",
844844
// Declare the function 'vector' to create the abstract type.
845845
globalOverload(
846-
"vector",
846+
"vector_type",
847847
ImmutableList.of(CelTypes.create(typeParam)),
848848
ImmutableList.of("T"),
849849
CelTypes.create(abstractType)),
850850
// Declare a function to create a new value of abstract type based on a list.
851851
globalOverload(
852-
"vector",
852+
"vector_list",
853853
ImmutableList.of(createList(typeParam)),
854854
ImmutableList.of("T"),
855855
abstractType));
@@ -870,23 +870,23 @@ public void abstractTypeParameterizedError() throws Exception {
870870
"vector",
871871
// Declare the function 'vector' to create the abstract type.
872872
globalOverload(
873-
"vector",
873+
"vector_type",
874874
ImmutableList.of(CelTypes.create(typeParam)),
875875
ImmutableList.of("T"),
876876
CelTypes.create(abstractType)),
877877
// Declare a function to create a new value of abstract type based on a list.
878878
globalOverload(
879-
"vector",
879+
"vector_list",
880880
ImmutableList.of(createList(typeParam)),
881881
ImmutableList.of("T"),
882882
abstractType));
883883
declareFunction(
884884
"add",
885885
globalOverload(
886-
"add",
886+
"add_vector_type",
887887
ImmutableList.of(CelTypes.create(abstractType), CelTypes.create(abstractType)),
888888
ImmutableList.of("T"),
889-
abstractType));
889+
CelTypes.create(abstractType)));
890890
source = "add(vector([1, 2]), vector([2u, -1])) == vector([1, 2, 2u, -1])";
891891
runTest();
892892
}
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
Source: type(vector([1])) == vector(dyn) && vector([1]).at(0) == 1
22
declare vector {
3-
function vector (type(T)) -> type(vector(T))
4-
function vector (list(T)) -> vector(T)
3+
function vector_type (type(T)) -> type(vector(T))
4+
function vector_list (list(T)) -> vector(T)
55
}
66
declare at {
7-
function at vector(T).(int) -> T
7+
function vector_at_int vector(T).(int) -> T
88
}
99
=====>
1010
_&&_(
@@ -14,20 +14,20 @@ _&&_(
1414
[
1515
1~int
1616
]~list(int)
17-
)~vector(int)^vector
17+
)~vector(int)^vector_list
1818
)~type(vector(int))^type,
1919
vector(
2020
dyn~type(dyn)^dyn
21-
)~type(vector(dyn))^vector
21+
)~type(vector(dyn))^vector_type
2222
)~bool^equals,
2323
_==_(
2424
vector(
2525
[
2626
1~int
2727
]~list(int)
28-
)~vector(int)^vector.at(
28+
)~vector(int)^vector_list.at(
2929
0~int
30-
)~int^at,
30+
)~int^vector_at_int,
3131
1~int
3232
)~bool^equals
3333
)~bool^logical_and

checker/src/test/resources/abstractTypeParameterizedError.baseline

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
Source: add(vector([1, 2]), vector([2u, -1])) == vector([1, 2, 2u, -1])
22
declare vector {
3-
function vector (type(T)) -> type(vector(T))
4-
function vector (list(T)) -> vector(T)
3+
function vector_type (type(T)) -> type(vector(T))
4+
function vector_list (list(T)) -> vector(T)
55
}
66
declare add {
7-
function add (type(vector(T)), type(vector(T))) -> vector(T)
7+
function add_vector_type (type(vector(T)), type(vector(T))) -> type(vector(T))
88
}
99
=====>
1010
ERROR: test_location:1:4: found no matching overload for 'add' applied to '(vector(int), vector(dyn))' (candidates: (type(vector(%T4)), type(vector(%T4))))

checker/src/test/resources/abstractTypeParameterizedInListLiteral.baseline

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Source: size([vector([1, 2]), vector([2u, -1])]) == 2
22
declare vector {
3-
function vector (type(T)) -> type(vector(T))
4-
function vector (list(T)) -> vector(T)
3+
function vector_type (type(T)) -> type(vector(T))
4+
function vector_list (list(T)) -> vector(T)
55
}
66
=====>
77
_==_(
@@ -12,13 +12,13 @@ _==_(
1212
1~int,
1313
2~int
1414
]~list(int)
15-
)~vector(int)^vector,
15+
)~vector(int)^vector_list,
1616
vector(
1717
[
1818
2u~uint,
1919
-1~int
2020
]~list(dyn)
21-
)~vector(dyn)^vector
21+
)~vector(dyn)^vector_list
2222
]~list(vector(dyn))
2323
)~int^size_list,
2424
2~int

checker/src/test/resources/jsonStructTypeError.baseline

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ource: x["iss"] != TestAllTypes{single_int32: 1}
1+
Source: x["iss"] != TestAllTypes{single_int32: 1}
22
declare x {
33
value google.protobuf.Struct
44
}

0 commit comments

Comments
 (0)