5959import com .google .rpc .context .AttributeContext ;
6060import com .google .testing .junit .testparameterinjector .TestParameter ;
6161import com .google .testing .junit .testparameterinjector .TestParameterInjector ;
62- import com .google .testing .junit .testparameterinjector .TestParameters ;
6362import dev .cel .checker .CelCheckerLegacyImpl ;
6463import dev .cel .checker .DescriptorTypeProvider ;
6564import dev .cel .checker .ProtoTypeMask ;
@@ -232,9 +231,7 @@ public void check() throws Exception {
232231 }
233232
234233 @ Test
235- @ TestParameters ("{useProtoResultType: false}" )
236- @ TestParameters ("{useProtoResultType: true}" )
237- public void compile (boolean useProtoResultType ) throws Exception {
234+ public void compile (@ TestParameter boolean useProtoResultType ) throws Exception {
238235 CelBuilder celBuilder = standardCelBuilderWithMacros ();
239236 if (useProtoResultType ) {
240237 celBuilder .setProtoResultType (CelProtoTypes .BOOL );
@@ -246,9 +243,7 @@ public void compile(boolean useProtoResultType) throws Exception {
246243 }
247244
248245 @ Test
249- @ TestParameters ("{useProtoResultType: false}" )
250- @ TestParameters ("{useProtoResultType: true}" )
251- public void compile_resultTypeCheckFailure (boolean useProtoResultType ) {
246+ public void compile_resultTypeCheckFailure (@ TestParameter boolean useProtoResultType ) {
252247 CelBuilder celBuilder = standardCelBuilderWithMacros ();
253248 if (useProtoResultType ) {
254249 celBuilder .setProtoResultType (CelProtoTypes .STRING );
@@ -563,23 +558,6 @@ public void program_withVars() throws Exception {
563558 assertThat (program .eval (ImmutableMap .of ("variable" , "hello" ))).isEqualTo (true );
564559 }
565560
566- @ Test
567- public void program_withCelValue () throws Exception {
568- Cel cel =
569- standardCelBuilderWithMacros ()
570- .setOptions (CelOptions .current ().enableCelValue (true ).build ())
571- .addDeclarations (
572- Decl .newBuilder ()
573- .setName ("variable" )
574- .setIdent (IdentDecl .newBuilder ().setType (CelProtoTypes .STRING ))
575- .build ())
576- .setResultType (SimpleType .BOOL )
577- .build ();
578-
579- CelRuntime .Program program = cel .createProgram (cel .compile ("variable == 'hello'" ).getAst ());
580-
581- assertThat (program .eval (ImmutableMap .of ("variable" , "hello" ))).isEqualTo (true );
582- }
583561
584562 @ Test
585563 public void program_withProtoVars () throws Exception {
@@ -1006,9 +984,8 @@ public void program_protoActivation() throws Exception {
1006984 }
1007985
1008986 @ Test
1009- @ TestParameters ("{resolveTypeDependencies: false}" )
1010- @ TestParameters ("{resolveTypeDependencies: true}" )
1011- public void program_enumTypeDirectResolution (boolean resolveTypeDependencies ) throws Exception {
987+ public void program_enumTypeDirectResolution (@ TestParameter boolean resolveTypeDependencies )
988+ throws Exception {
1012989 Cel cel =
1013990 standardCelBuilderWithMacros ()
1014991 .addFileTypes (StandaloneGlobalEnum .getDescriptor ().getFile ())
@@ -1029,9 +1006,7 @@ public void program_enumTypeDirectResolution(boolean resolveTypeDependencies) th
10291006 }
10301007
10311008 @ Test
1032- @ TestParameters ("{resolveTypeDependencies: false}" )
1033- @ TestParameters ("{resolveTypeDependencies: true}" )
1034- public void program_enumTypeReferenceResolution (boolean resolveTypeDependencies )
1009+ public void program_enumTypeReferenceResolution (@ TestParameter boolean resolveTypeDependencies )
10351010 throws Exception {
10361011 Cel cel =
10371012 standardCelBuilderWithMacros ()
@@ -1429,25 +1404,6 @@ public void programAdvanceEvaluation_nestedSelect() throws Exception {
14291404 .isEqualTo (CelUnknownSet .create (CelAttribute .fromQualifiedIdentifier ("com.google.a" )));
14301405 }
14311406
1432- @ Test
1433- public void programAdvanceEvaluation_nestedSelect_withCelValue () throws Exception {
1434- Cel cel =
1435- standardCelBuilderWithMacros ()
1436- .setOptions (
1437- CelOptions .current ().enableUnknownTracking (true ).enableCelValue (true ).build ())
1438- .addVar ("com" , MapType .create (SimpleType .STRING , SimpleType .DYN ))
1439- .addFunctionBindings ()
1440- .setResultType (SimpleType .BOOL )
1441- .build ();
1442- CelRuntime .Program program = cel .createProgram (cel .compile ("com.google.a || false" ).getAst ());
1443-
1444- assertThat (
1445- program .advanceEvaluation (
1446- UnknownContext .create (
1447- fromMap (ImmutableMap .of ()),
1448- ImmutableList .of (CelAttributePattern .fromQualifiedIdentifier ("com.google.a" )))))
1449- .isEqualTo (CelUnknownSet .create (CelAttribute .fromQualifiedIdentifier ("com.google.a" )));
1450- }
14511407
14521408 @ Test
14531409 public void programAdvanceEvaluation_argumentMergeErrorPriority () throws Exception {
0 commit comments