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

Function TEST_F

eval/public/extension_func_test.cc:264–277  ·  view source on GitHub ↗

Test string startsWith() function.

Source from the content-addressed store, hash-verified

262
263// Test string startsWith() function.
264TEST_F(ExtensionTest, TestStartsWithFunction) {
265 // Empty string, non-empty prefix - never matches.
266 EXPECT_NO_FATAL_FAILURE(TestStringStartsWith("", "p", false));
267 // Prefix of 0 length - always matches.
268 EXPECT_NO_FATAL_FAILURE(TestStringStartsWith("", "", true));
269 EXPECT_NO_FATAL_FAILURE(TestStringStartsWith("prefixedString", "", true));
270 // Non-empty matching prefix.
271 EXPECT_NO_FATAL_FAILURE(
272 TestStringStartsWith("prefixedString", "prefix", true));
273 // Non-empty mismatching prefix.
274 EXPECT_NO_FATAL_FAILURE(TestStringStartsWith("prefixedString", "x", false));
275 EXPECT_NO_FATAL_FAILURE(
276 TestStringStartsWith("prefixedString", "prefixedString1", false));
277}
278
279// Test string startsWith() function.
280TEST_F(ExtensionTest, TestEndsWithFunction) {

Callers

nothing calls this directly

Calls 9

TimestampOrDieMethod · 0.80
codeMethod · 0.80
ErrorOrDieMethod · 0.80
DurationOrDieMethod · 0.80
BoolOrDieMethod · 0.80
MessageOrDieMethod · 0.80
IsTimestampMethod · 0.45
IsErrorMethod · 0.45
IsDurationMethod · 0.45

Tested by

no test coverage detected