MCPcopy Create free account
hub / github.com/cel-expr/cel-cpp / TEST

Function TEST

validator/timestamp_literal_validator_test.cc:53–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51};
52
53TEST(TimestampLiteralValidatorTest, FormatsIssues) {
54 Validator validator;
55 validator.AddValidation(TimestampLiteralValidator());
56
57 ASSERT_OK_AND_ASSIGN(auto compiler, StdLibCompiler());
58 ASSERT_OK_AND_ASSIGN(cel::ValidationResult result,
59 compiler->Compile("timestamp('invalid')"));
60
61 validator.UpdateValidationResult(result);
62
63 EXPECT_FALSE(result.IsValid());
64 EXPECT_EQ(result.FormatError(),
65 R"(ERROR: <input>:1:11: invalid timestamp literal
66 | timestamp('invalid')
67 | ..........^)");
68}
69
70TEST(TimestampLiteralValidatorTest, AccumulatesIssues) {
71 Validator validator;

Callers

nothing calls this directly

Calls 4

AddValidationMethod · 0.80
IsValidMethod · 0.80
FormatErrorMethod · 0.80

Tested by

no test coverage detected