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

Function ExampleStringEquals

core/assert/string_test.go:20–34  ·  view source on GitHub ↗

An example of testing string equality

()

Source from the content-addressed store, hash-verified

18
19// An example of testing string equality
20func ExampleStringEquals() {
21 assert := assert.To(nil)
22 assert.For(`"a" Equals "a"`).ThatString("a").Equals("a")
23 assert.For(`"a" Equals "b"`).ThatString("a").Equals("b")
24 assert.For(`"a" NotEquals "a"`).ThatString("a").NotEquals("a")
25 assert.For(`"a" NotEquals "b"`).ThatString("a").NotEquals("b")
26 // Output:
27 // Error:"a" Equals "b"
28 // Got `a`
29 // Expect == `b`
30 // Differs from `a`
31 // Error:"a" NotEquals "a"
32 // Got `a`
33 // Expect != `a`
34}
35
36// An example of testing partial string equality
37func ExampleStringFragments() {

Callers

nothing calls this directly

Calls 4

ThatStringMethod · 0.80
ForMethod · 0.80
EqualsMethod · 0.65
NotEqualsMethod · 0.45

Tested by

no test coverage detected