MCPcopy Create free account
hub / github.com/google/gapid / ThatString

Method ThatString

core/assert/string.go:31–42  ·  view source on GitHub ↗

ThatString returns an OnString for string based assertions. The untyped argument is converted to a string using fmt.Sprint, and the result supports string specific tests.

(value interface{})

Source from the content-addressed store, hash-verified

29// ThatString returns an OnString for string based assertions.
30// The untyped argument is converted to a string using fmt.Sprint, and the result supports string specific tests.
31func (a Assertion) ThatString(value interface{}) OnString {
32 s := ""
33 switch v := value.(type) {
34 case string:
35 s = v
36 case []byte:
37 s = string(v)
38 default:
39 s = fmt.Sprint(value)
40 }
41 return OnString{Assertion: a, value: s}
42}
43
44// Equals asserts that the supplied string is equal to the expected string.
45func (o OnString) Equals(expect string) bool {

Callers 15

TestEnvGetFunction · 0.80
TestCommandCaptureStdoutFunction · 0.80
TestCommandCaptureStderrFunction · 0.80
TestCommandStdinFunction · 0.80
TestCommandCallFunction · 0.80
TestCommandEnvironmentFunction · 0.80
TestDimensionFunction · 0.80
TestADBShellFunction · 0.80
TestHostFunction · 0.80
TestDedupeFunction · 0.80

Calls 1

SprintMethod · 0.80

Tested by 15

TestEnvGetFunction · 0.64
TestCommandCaptureStdoutFunction · 0.64
TestCommandCaptureStderrFunction · 0.64
TestCommandStdinFunction · 0.64
TestCommandCallFunction · 0.64
TestCommandEnvironmentFunction · 0.64
TestDimensionFunction · 0.64
TestADBShellFunction · 0.64
TestHostFunction · 0.64
TestDedupeFunction · 0.64