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