| 802 | } |
| 803 | |
| 804 | func TestExactly(t *testing.T) { |
| 805 | |
| 806 | mockT := new(testing.T) |
| 807 | |
| 808 | a := float32(1) |
| 809 | b := float64(1) |
| 810 | c := float32(1) |
| 811 | d := float32(2) |
| 812 | cases := []struct { |
| 813 | expected interface{} |
| 814 | actual interface{} |
| 815 | result bool |
| 816 | }{ |
| 817 | {a, b, false}, |
| 818 | {a, d, false}, |
| 819 | {a, c, true}, |
| 820 | {nil, a, false}, |
| 821 | {a, nil, false}, |
| 822 | } |
| 823 | |
| 824 | for _, c := range cases { |
| 825 | t.Run(fmt.Sprintf("Exactly(%#v, %#v)", c.expected, c.actual), func(t *testing.T) { |
| 826 | res := Exactly(mockT, c.expected, c.actual) |
| 827 | |
| 828 | if res != c.result { |
| 829 | t.Errorf("Exactly(%#v, %#v) should return %#v", c.expected, c.actual, c.result) |
| 830 | } |
| 831 | }) |
| 832 | } |
| 833 | } |
| 834 | |
| 835 | func TestNotEqual(t *testing.T) { |
| 836 | |