Skip to content

Commit f49d834

Browse files
CEL Dev Teamcopybara-github
authored andcommitted
Internal change
PiperOrigin-RevId: 772218576
1 parent f1b9a60 commit f49d834

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

testing/src/main/java/dev/cel/testing/testrunner/DefaultResultMatcher.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
import static com.google.common.truth.Truth.assertThat;
1717
import static com.google.common.truth.extensions.proto.ProtoTruth.assertThat;
18+
import static com.google.protobuf.LegacyUnredactedTextFormat.legacyUnredactedStringValueOf;
1819
import static dev.cel.testing.utils.ExprValueUtils.toExprValue;
1920

2021
import dev.cel.expr.ExprValue;
@@ -69,7 +70,7 @@ public void match(ResultMatcherParams params, Cel cel) throws Exception {
6970
if (params.computedOutput().kind().equals(ComputedOutput.Kind.EXPR_VALUE)) {
7071
throw new AssertionError(
7172
"Evaluation was successful but no value was provided. Computed output: "
72-
+ params.computedOutput().exprValue());
73+
+ legacyUnredactedStringValueOf(params.computedOutput().exprValue()));
7374
}
7475
assertThat(params.computedOutput().error().toString())
7576
.contains(result.evalError().get(0).toString());

testing/src/test/java/dev/cel/testing/testrunner/DefaultResultMatcherTest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,9 @@ public void match_expectedEvalErrorAndComputedExprValue_failure() throws Excepti
123123

124124
assertThat(thrown)
125125
.hasMessageThat()
126-
.contains("Evaluation was successful but no value was provided. Computed output:");
127-
assertThat(thrown).hasMessageThat().contains("value {\n int64_value: 3\n}");
126+
.contains(
127+
"Evaluation was successful but no value was provided. Computed output: value {\n"
128+
+ " int64_value: 3\n"
129+
+ "}");
128130
}
129131
}

0 commit comments

Comments
 (0)