An example of testing untyped nil values
()
| 47 | |
| 48 | // An example of testing untyped nil values |
| 49 | func ExampleNil() { |
| 50 | assert := assert.To(nil) |
| 51 | assert.For("nil equals nil").That(nil).Equals(nil) |
| 52 | assert.For("nil does not equal nil").That(nil).NotEquals(nil) |
| 53 | assert.For("nil deep equals nil").That(nil).DeepEquals(nil) |
| 54 | assert.For("nil is nil").That(nil).IsNil() |
| 55 | assert.For("nil is not nil").That(nil).IsNotNil() |
| 56 | // Output: |
| 57 | // Error:nil does not equal nil |
| 58 | // Got <nil> |
| 59 | // Expect != <nil> |
| 60 | // Error:nil is not nil |
| 61 | // Got <nil> |
| 62 | // Expect != `nil` |
| 63 | } |
| 64 | |
| 65 | // An example of testing typed nil values |
| 66 | func ExampleTypedNil() { |