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

Function TestBytesEscaping

internal/strings_test.cc:78–86  ·  view source on GitHub ↗

is the quoted version of and represents the original string mentioned in the test case. This method compares the unescaped against its round trip version i.e. after carrying out escaping followed by unescaping on it.

Source from the content-addressed store, hash-verified

76// This method compares the unescaped <unquoted> against its round trip version
77// i.e. after carrying out escaping followed by unescaping on it.
78void TestBytesEscaping(const std::string& unquoted, const std::string& quoted) {
79 ASSERT_OK_AND_ASSIGN(auto unescaped, UnescapeBytes(unquoted));
80 const std::string escaped = EscapeBytes(unescaped);
81 ASSERT_OK_AND_ASSIGN(auto unescaped2, UnescapeBytes(escaped));
82 EXPECT_EQ(unescaped, unescaped2);
83 std::string escaped2 = EscapeBytes(unescaped, true);
84 ASSERT_OK_AND_ASSIGN(auto unescaped3, UnescapeBytes(escaped2));
85 EXPECT_EQ(unescaped, unescaped3);
86}
87
88// <quoted> takes a byte literal of the form b'...', b'''...'''
89void TestBytesLiteral(const std::string& quoted) {

Callers 1

TestBytesLiteralFunction · 0.85

Calls 1

EscapeBytesFunction · 0.85

Tested by

no test coverage detected