Assert compares the arguments with the specified objects and fails if they do not exactly match.
(t TestingT, objects ...interface{})
| 1059 | // Assert compares the arguments with the specified objects and fails if |
| 1060 | // they do not exactly match. |
| 1061 | func (args Arguments) Assert(t TestingT, objects ...interface{}) bool { |
| 1062 | if h, ok := t.(tHelper); ok { |
| 1063 | h.Helper() |
| 1064 | } |
| 1065 | |
| 1066 | // get the differences |
| 1067 | diff, diffCount := args.Diff(objects) |
| 1068 | |
| 1069 | if diffCount == 0 { |
| 1070 | return true |
| 1071 | } |
| 1072 | |
| 1073 | // there are differences... report them... |
| 1074 | t.Logf(diff) |
| 1075 | t.Errorf("%sArguments do not match.", assert.CallerInfo()) |
| 1076 | |
| 1077 | return false |
| 1078 | } |
| 1079 | |
| 1080 | // String gets the argument at the specified index. Panics if there is no argument, or |
| 1081 | // if the argument is of the wrong type. |