From d6f43e1670afd03c1c5aa495bb3ec9a7a29fea8f Mon Sep 17 00:00:00 2001 From: Sean Huh Date: Mon, 23 Nov 2026 15:50:49 -0800 Subject: [PATCH] Fix cel-cpp Java baseline diff test PiperOrigin-RevId: 1028527875 --- .../java/dev/cel/checker/ExprCheckerTest.java | 26 -------------- ...olute_declInNonComprehensionScope.baseline | 34 ------------------- 2 files changed, 60 deletions(-) delete mode 100644 checker/src/test/resources/referenceAbsolute_declInNonComprehensionScope.baseline diff --git a/checker/src/test/java/dev/cel/checker/ExprCheckerTest.java b/checker/src/test/java/dev/cel/checker/ExprCheckerTest.java index 2d3b8eeb7..60bf7e567 100644 --- a/checker/src/test/java/dev/cel/checker/ExprCheckerTest.java +++ b/checker/src/test/java/dev/cel/checker/ExprCheckerTest.java @@ -33,13 +33,11 @@ import dev.cel.common.CelMutableAst; import dev.cel.common.CelProtoAbstractSyntaxTree; import dev.cel.common.CelProtoDeclConverter; -import dev.cel.common.CelVarDecl; import dev.cel.common.ast.CelConstant; import dev.cel.common.internal.EnvVisitable; import dev.cel.common.internal.EnvVisitor; import dev.cel.common.internal.Errors; import dev.cel.common.types.CelType; -import dev.cel.common.types.CelTypeProvider; import dev.cel.common.types.ListType; import dev.cel.common.types.MapType; import dev.cel.common.types.NullableType; @@ -234,30 +232,6 @@ public void referenceTypeAbsolute() throws Exception { runTest(); } - @Test - @SuppressWarnings("deprecation") // ExprChecker is used directly to add a non-comprehension scope. - public void referenceAbsolute_declInNonComprehensionScope() throws Exception { - source = "[1].all(x, .x == 'a') && .x == 'a'"; - CelTypeProvider typeProvider = ProtoMessageTypeProvider.newBuilder().build(); - prepareCompiler(typeProvider); - Errors errors = new Errors("", source); - Env env = Env.standard(errors, typeProvider, null, TEST_OPTIONS); - env.enterScope(); - env.add(CelVarDecl.newVarDeclaration("x", SimpleType.STRING)); - - CelAbstractSyntaxTree ast = - ExprChecker.typecheck( - env, container, celCompiler.parse(source).getAst(), Optional.absent()); - - testOutput().println(errors.getAllErrorsAsString()); - testOutput() - .println( - CelDebug.toAdornedDebugString( - CelProtoAbstractSyntaxTree.fromCelAst(ast).getExpr(), - new CheckedExprAdorner( - CelProtoAbstractSyntaxTree.fromCelAst(ast).toCheckedExpr()))); - } - @Test public void referenceValue() throws Exception { declareVariable( diff --git a/checker/src/test/resources/referenceAbsolute_declInNonComprehensionScope.baseline b/checker/src/test/resources/referenceAbsolute_declInNonComprehensionScope.baseline deleted file mode 100644 index e63a1f129..000000000 --- a/checker/src/test/resources/referenceAbsolute_declInNonComprehensionScope.baseline +++ /dev/null @@ -1,34 +0,0 @@ -Source: [1].all(x, .x == 'a') && .x == 'a' -=====> - -_&&_( - __comprehension__( - // Variable - x, - // Target - [ - 1~int - ]~list(int), - // Accumulator - @result, - // Init - true~bool, - // LoopCondition - @not_strictly_false( - @result~bool^@result - )~bool^not_strictly_false, - // LoopStep - _&&_( - @result~bool^@result, - _==_( - .x~string^.x, - "a"~string - )~bool^equals - )~bool^logical_and, - // Result - @result~bool^@result)~bool, - _==_( - .x~string^.x, - "a"~string - )~bool^equals -)~bool^logical_and