CheckEqual checks that the value is equal to some reference.
(val, ref interface{})
| 120 | |
| 121 | // CheckEqual checks that the value is equal to some reference. |
| 122 | func (t *T) CheckEqual(val, ref interface{}) { |
| 123 | t.Helper() |
| 124 | if val != ref { |
| 125 | t.failWithf(false, "values not equal\n got: %# v\nexpected: %# v", |
| 126 | pretty.Formatter(val), pretty.Formatter(ref)) |
| 127 | } |
| 128 | } |
| 129 | |
| 130 | func (t *T) CheckContains(s, substr string) { |
| 131 | t.Helper() |