IsType asserts that the specified objects are of the same type.
(t TestingT, expectedType interface{}, object interface{}, msgAndArgs ...interface{})
| 439 | |
| 440 | // IsType asserts that the specified objects are of the same type. |
| 441 | func IsType(t TestingT, expectedType interface{}, object interface{}, msgAndArgs ...interface{}) bool { |
| 442 | if h, ok := t.(tHelper); ok { |
| 443 | h.Helper() |
| 444 | } |
| 445 | |
| 446 | if !ObjectsAreEqual(reflect.TypeOf(object), reflect.TypeOf(expectedType)) { |
| 447 | return Fail(t, fmt.Sprintf("Object expected to be of type %v, but was %v", reflect.TypeOf(expectedType), reflect.TypeOf(object)), msgAndArgs...) |
| 448 | } |
| 449 | |
| 450 | return true |
| 451 | } |
| 452 | |
| 453 | // Equal asserts that two objects are equal. |
| 454 | // |