An example of testing string equality
()
| 18 | |
| 19 | // An example of testing string equality |
| 20 | func 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 |
| 37 | func ExampleStringFragments() { |
nothing calls this directly
no test coverage detected