@@ -22,6 +22,7 @@ func TestCompare(t *testing.T) {
2222 type customFloat32 float32
2323 type customFloat64 float64
2424 type customString string
25+ type customUintptr uintptr
2526 for _ , currCase := range []struct {
2627 less interface {}
2728 greater interface {}
@@ -52,6 +53,8 @@ func TestCompare(t *testing.T) {
5253 {less : customFloat32 (1.23 ), greater : customFloat32 (2.23 ), cType : "float32" },
5354 {less : float64 (1.23 ), greater : float64 (2.34 ), cType : "float64" },
5455 {less : customFloat64 (1.23 ), greater : customFloat64 (2.34 ), cType : "float64" },
56+ {less : uintptr (1 ), greater : uintptr (2 ), cType : "uintptr" },
57+ {less : customUintptr (1 ), greater : customUintptr (2 ), cType : "uint64" },
5558 } {
5659 resLess , isComparable := compare (currCase .less , currCase .greater , reflect .ValueOf (currCase .less ).Kind ())
5760 if ! isComparable {
@@ -148,6 +151,7 @@ func TestGreater(t *testing.T) {
148151 {less : uint64 (1 ), greater : uint64 (2 ), msg : `"1" is not greater than "2"` },
149152 {less : float32 (1.23 ), greater : float32 (2.34 ), msg : `"1.23" is not greater than "2.34"` },
150153 {less : float64 (1.23 ), greater : float64 (2.34 ), msg : `"1.23" is not greater than "2.34"` },
154+ {less : uintptr (1 ), greater : uintptr (2 ), msg : `"1" is not greater than "2"` },
151155 } {
152156 out := & outputT {buf : bytes .NewBuffer (nil )}
153157 False (t , Greater (out , currCase .less , currCase .greater ))
@@ -189,6 +193,7 @@ func TestGreaterOrEqual(t *testing.T) {
189193 {less : uint64 (1 ), greater : uint64 (2 ), msg : `"1" is not greater than or equal to "2"` },
190194 {less : float32 (1.23 ), greater : float32 (2.34 ), msg : `"1.23" is not greater than or equal to "2.34"` },
191195 {less : float64 (1.23 ), greater : float64 (2.34 ), msg : `"1.23" is not greater than or equal to "2.34"` },
196+ {less : uintptr (1 ), greater : uintptr (2 ), msg : `"1" is not greater than or equal to "2"` },
192197 } {
193198 out := & outputT {buf : bytes .NewBuffer (nil )}
194199 False (t , GreaterOrEqual (out , currCase .less , currCase .greater ))
@@ -230,6 +235,7 @@ func TestLess(t *testing.T) {
230235 {less : uint64 (1 ), greater : uint64 (2 ), msg : `"2" is not less than "1"` },
231236 {less : float32 (1.23 ), greater : float32 (2.34 ), msg : `"2.34" is not less than "1.23"` },
232237 {less : float64 (1.23 ), greater : float64 (2.34 ), msg : `"2.34" is not less than "1.23"` },
238+ {less : uintptr (1 ), greater : uintptr (2 ), msg : `"2" is not less than "1"` },
233239 } {
234240 out := & outputT {buf : bytes .NewBuffer (nil )}
235241 False (t , Less (out , currCase .greater , currCase .less ))
@@ -271,6 +277,7 @@ func TestLessOrEqual(t *testing.T) {
271277 {less : uint64 (1 ), greater : uint64 (2 ), msg : `"2" is not less than or equal to "1"` },
272278 {less : float32 (1.23 ), greater : float32 (2.34 ), msg : `"2.34" is not less than or equal to "1.23"` },
273279 {less : float64 (1.23 ), greater : float64 (2.34 ), msg : `"2.34" is not less than or equal to "1.23"` },
280+ {less : uintptr (1 ), greater : uintptr (2 ), msg : `"2" is not less than or equal to "1"` },
274281 } {
275282 out := & outputT {buf : bytes .NewBuffer (nil )}
276283 False (t , LessOrEqual (out , currCase .greater , currCase .less ))
0 commit comments