Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 4 additions & 22 deletions bundle/src/test/java/dev/cel/bundle/CelImplTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,6 @@ public void program_messageConstruction() throws Exception {
public void program_duplicateTypeDescriptor() throws Exception {
Cel cel =
standardCelBuilderWithMacros()
.setOptions(CelOptions.current().evaluateCanonicalTypesToNativeValues(true).build())
.addMessageTypes(Timestamp.getDescriptor())
.addMessageTypes(ImmutableList.of(Timestamp.getDescriptor()))
.setContainer(CelContainer.ofName("google"))
Expand All @@ -833,7 +832,6 @@ public void program_duplicateTypeDescriptor() throws Exception {
public void program_hermeticDescriptors_wellKnownProtobuf() throws Exception {
Cel cel =
standardCelBuilderWithMacros()
.setOptions(CelOptions.current().evaluateCanonicalTypesToNativeValues(true).build())
.addMessageTypes(Timestamp.getDescriptor())
.setContainer(CelContainer.ofName("google"))
.setResultType(SimpleType.TIMESTAMP)
Expand Down Expand Up @@ -962,7 +960,6 @@ public void program_deepTypeResolutionDisabledForRuntime_fails() throws Exceptio
public void program_typeProvider() throws Exception {
Cel cel =
standardCelBuilderWithMacros()
.setOptions(CelOptions.current().evaluateCanonicalTypesToNativeValues(true).build())
.setTypeProvider(
new DescriptorTypeProvider(ImmutableList.of(Timestamp.getDescriptor())))
.setContainer(CelContainer.ofName("google"))
Expand Down Expand Up @@ -1029,10 +1026,7 @@ public void program_enumTypeReferenceResolution(boolean resolveTypeDependencies)
Cel cel =
standardCelBuilderWithMacros()
.setOptions(
CelOptions.current()
.evaluateCanonicalTypesToNativeValues(true)
.resolveTypeDependencies(resolveTypeDependencies)
.build())
CelOptions.current().resolveTypeDependencies(resolveTypeDependencies).build())
.addMessageTypes(Struct.getDescriptor())
.setResultType(StructTypeReference.create("google.protobuf.NullValue"))
.setContainer(CelContainer.ofName("google.protobuf"))
Expand All @@ -1050,11 +1044,7 @@ public void program_enumTypeReferenceResolution(boolean resolveTypeDependencies)
public void program_enumTypeTransitiveResolution() throws Exception {
Cel cel =
standardCelBuilderWithMacros()
.setOptions(
CelOptions.current()
.evaluateCanonicalTypesToNativeValues(true)
.resolveTypeDependencies(true)
.build())
.setOptions(CelOptions.current().resolveTypeDependencies(true).build())
.addMessageTypes(Proto2ExtensionScopedMessage.getDescriptor())
.setResultType(StructTypeReference.create("google.protobuf.NullValue"))
.setContainer(CelContainer.ofName("google.protobuf"))
Expand Down Expand Up @@ -1643,11 +1633,7 @@ public void programAdvanceEvaluation_indexOnUnknownContainer() throws Exception
public void programAdvanceEvaluation_unsupportedIndexIgnored() throws Exception {
Cel cel =
standardCelBuilderWithMacros()
.setOptions(
CelOptions.current()
.evaluateCanonicalTypesToNativeValues(true)
.enableUnknownTracking(true)
.build())
.setOptions(CelOptions.current().enableUnknownTracking(true).build())
.addVar("unk", MapType.create(SimpleType.STRING, SimpleType.BOOL))
.setContainer(CelContainer.ofName(""))
.addFunctionBindings()
Expand Down Expand Up @@ -2168,11 +2154,7 @@ public void program_fdsContainsWktDependency_descriptorInstancesMatch() throws E
Cel cel =
standardCelBuilderWithMacros()
.addMessageTypes(descriptors)
.setOptions(
CelOptions.current()
.evaluateCanonicalTypesToNativeValues(true)
.enableTimestampEpoch(true)
.build())
.setOptions(CelOptions.current().enableTimestampEpoch(true).build())
.setContainer(CelContainer.ofName("cel.expr.conformance.proto3"))
.build();
CelAbstractSyntaxTree ast =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public void adaptValueToProto_bidirectionalConversion() {
ProtoAdapter protoAdapter =
new ProtoAdapter(
dynamicProto,
CelOptions.current().evaluateCanonicalTypesToNativeValues(true).build());
CelOptions.current().build());
assertThat(protoAdapter.adaptValueToProto(value, proto.getDescriptorForType().getFullName()))
.isEqualTo(proto);
assertThat(protoAdapter.adaptProtoToValue(proto)).isEqualTo(value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public void newValue_createEmptyProtoMessage() {
public void newValue_createProtoMessage_fieldsPopulated() {
ProtoMessageValueProvider protoMessageValueProvider =
ProtoMessageValueProvider.newInstance(
CelOptions.current().evaluateCanonicalTypesToNativeValues(true).build(), DYNAMIC_PROTO);
CelOptions.current().build(), DYNAMIC_PROTO);

ProtoMessageValue protoMessageValue =
(ProtoMessageValue)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ public final class ConformanceTest extends Statement {

private static final CelOptions OPTIONS =
CelOptions.current()
.evaluateCanonicalTypesToNativeValues(true)
.enableTimestampEpoch(true)
.enableHeterogeneousNumericComparisons(true)
.enableProtoDifferencerEquality(true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
@RunWith(TestParameterInjector.class)
public class CelEncoderExtensionsTest {
private static final CelOptions CEL_OPTIONS =
CelOptions.current().evaluateCanonicalTypesToNativeValues(true).build();
CelOptions.current().build();

private static final CelCompiler CEL_COMPILER =
CelCompilerFactory.standardCelCompilerBuilder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ private static CelBuilder newCelBuilder(int version) {
return CelFactory.standardCelBuilder()
.setOptions(
CelOptions.current()
.evaluateCanonicalTypesToNativeValues(true)
.enableTimestampEpoch(true)
.build())
.setStandardMacros(CelStandardMacro.STANDARD_MACROS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ public class ConstantFoldingOptimizerTest {
private static final CelOptions CEL_OPTIONS =
CelOptions.current()
.enableTimestampEpoch(true)
.evaluateCanonicalTypesToNativeValues(true)
.build();
private static final Cel CEL =
CelFactory.standardCelBuilder()
Expand Down
1 change: 0 additions & 1 deletion runtime/src/main/java/dev/cel/runtime/LiteRuntimeImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ private Builder() {
this.celOptions =
CelOptions.current()
.enableCelValue(true)
.evaluateCanonicalTypesToNativeValues(true)
.build();
this.celValueProvider = (structType, fields) -> Optional.empty();
this.customFunctionBindings = new HashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ public abstract class BaseInterpreterTest extends CelBaselineTestCase {
.enableTimestampEpoch(true)
.enableHeterogeneousNumericComparisons(true)
.enableOptionalSyntax(true)
.evaluateCanonicalTypesToNativeValues(true)
.comprehensionMaxIterations(1_000)
.build();
private CelRuntime celRuntime;
Expand Down