AssertNE checks `value` and `expect` NOT EQUAL.
(value, expect any)
| 85 | |
| 86 | // AssertNE checks `value` and `expect` NOT EQUAL. |
| 87 | func AssertNE(value, expect any) { |
| 88 | rvExpect := reflect.ValueOf(expect) |
| 89 | if empty.IsNil(value) { |
| 90 | value = nil |
| 91 | } |
| 92 | if rvExpect.Kind() == reflect.Map { |
| 93 | if err := compareMap(value, expect); err == nil { |
| 94 | panic(fmt.Sprintf(`[ASSERT] EXPECT %v != %v`, value, expect)) |
| 95 | } |
| 96 | return |
| 97 | } |
| 98 | var ( |
| 99 | strValue = gconv.String(value) |
| 100 | strExpect = gconv.String(expect) |
| 101 | ) |
| 102 | if strValue == strExpect { |
| 103 | panic(fmt.Sprintf(`[ASSERT] EXPECT %v != %v`, strValue, strExpect)) |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | // AssertNQ checks `value` and `expect` NOT EQUAL, including their TYPES. |
| 108 | func AssertNQ(value, expect any) { |
searching dependent graphs…