| 908 | } |
| 909 | |
| 910 | func TestExactly(t *testing.T) { |
| 911 | t.Parallel() |
| 912 | mockT := new(testing.T) |
| 913 | |
| 914 | a := float32(1) |
| 915 | b := float64(1) |
| 916 | c := float32(1) |
| 917 | d := float32(2) |
| 918 | cases := []struct { |
| 919 | expected interface{} |
| 920 | actual interface{} |
| 921 | result bool |
| 922 | }{ |
| 923 | {a, b, false}, |
| 924 | {a, d, false}, |
| 925 | {a, c, true}, |
| 926 | {nil, a, false}, |
| 927 | {a, nil, false}, |
| 928 | } |
| 929 | |
| 930 | for _, c := range cases { |
| 931 | t.Run(fmt.Sprintf("Exactly(%#v, %#v)", c.expected, c.actual), func(t *testing.T) { |
| 932 | res := Exactly(mockT, c.expected, c.actual) |
| 933 | |
| 934 | if res != c.result { |
| 935 | t.Errorf("Exactly(%#v, %#v) should return %#v", c.expected, c.actual, c.result) |
| 936 | } |
| 937 | }) |
| 938 | } |
| 939 | } |
| 940 | |
| 941 | func TestNotEqual(t *testing.T) { |
| 942 | t.Parallel() |