MCPcopy Create free account
hub / github.com/cel-expr/cel-go / Compare

Function Compare

test/compare.go:24–26  ·  view source on GitHub ↗

Compare compares two strings, a for actual, e for expected, and returns true or false. The comparison is done, by filtering out whitespace (i.e. space, tabs and newline).

(a string, e string)

Source from the content-addressed store, hash-verified

22// Compare compares two strings, a for actual, e for expected, and returns true or false. The comparison is done,
23// by filtering out whitespace (i.e. space, tabs and newline).
24func Compare(a string, e string) bool {
25 return stripWhitespace(a) == stripWhitespace(e)
26}
27
28// DiffMessage creates a diff dump message for test failures.
29func DiffMessage(context string, actual interface{}, expected interface{}) string {

Callers 15

TestPruneFunction · 0.92
TestCheckFunction · 0.92
BenchmarkCheckFunction · 0.92
TestParseFunction · 0.92
TestProtosParseErrorsFunction · 0.92

Calls 1

stripWhitespaceFunction · 0.70

Tested by 15

TestPruneFunction · 0.74
TestCheckFunction · 0.74
BenchmarkCheckFunction · 0.74
TestParseFunction · 0.74
TestProtosParseErrorsFunction · 0.74