Samef asserts that two pointers reference the same object. assert.Samef(t, ptr1, ptr2, "error message %s", "formatted") Both arguments must be pointer variables. Pointer variable sameness is determined based on the equality of both type and value.
(t TestingT, expected interface{}, actual interface{}, msg string, args ...interface{})
| 1899 | // Both arguments must be pointer variables. Pointer variable sameness is |
| 1900 | // determined based on the equality of both type and value. |
| 1901 | func Samef(t TestingT, expected interface{}, actual interface{}, msg string, args ...interface{}) { |
| 1902 | if h, ok := t.(tHelper); ok { |
| 1903 | h.Helper() |
| 1904 | } |
| 1905 | if assert.Samef(t, expected, actual, msg, args...) { |
| 1906 | return |
| 1907 | } |
| 1908 | t.FailNow() |
| 1909 | } |
| 1910 | |
| 1911 | // Subset asserts that the specified list(array, slice...) or map contains all |
| 1912 | // elements given in the specified subset list(array, slice...) or map. |