equals fails the test if exp is not equal to act.
(tb testing.TB, exp, act interface{})
| 35 | |
| 36 | // equals fails the test if exp is not equal to act. |
| 37 | func equals(tb testing.TB, exp, act interface{}) { |
| 38 | tb.Helper() |
| 39 | if exp, oke := exp.(string); oke { |
| 40 | if act, ok := act.(string); ok { |
| 41 | eq := strings.EqualFold(exp, act) |
| 42 | if !eq { |
| 43 | tb.Errorf("expected: %#v got: %#v", exp, act) |
| 44 | } |
| 45 | return |
| 46 | } |
| 47 | } |
| 48 | /*if _, ok := exp.([]string); ok { |
| 49 | sort.Strings(exp.([]string)) |
| 50 | } |
| 51 | if _, ok := act.([]string); ok { |
| 52 | sort.Strings(act.([]string)) |
| 53 | }*/ |
| 54 | if !reflect.DeepEqual(exp, act) { |
| 55 | tb.Errorf("expected: %#v got: %#v", exp, act) |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | func equalStr(tb testing.TB, want, have string) { |
| 60 | tb.Helper() |
no outgoing calls
no test coverage detected