MCPcopy Create free account
hub / github.com/expr-lang/expr / stringizeWants

Function stringizeWants

internal/spew/common_test.go:94–104  ·  view source on GitHub ↗

stringizeWants converts a slice of wanted test output into a format suitable for a test error message.

(wants []string)

Source from the content-addressed store, hash-verified

92// stringizeWants converts a slice of wanted test output into a format suitable
93// for a test error message.
94func stringizeWants(wants []string) string {
95 s := ""
96 for i, want := range wants {
97 if i > 0 {
98 s += fmt.Sprintf("want%d: %s", i+1, want)
99 } else {
100 s += "want: " + want
101 }
102 }
103 return s
104}
105
106// testFailed returns whether or not a test failed by checking if the result
107// of the test is in the slice of wanted strings.

Callers 2

TestFormatterFunction · 0.85
TestDumpFunction · 0.85

Calls 1

SprintfMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…