@@ -3,6 +3,7 @@ package assert
33import (
44 "reflect"
55 "testing"
6+ "time"
67)
78
89func TestGt (t * testing.T ) {
@@ -25,6 +26,9 @@ func TestGt(t *testing.T) {
2526 testGt (a , mockA , float32 (2.0 ), 1.0 , true )
2627 testGt (a , mockA , "ABC" , "BCD" , false )
2728 testGt (a , mockA , "ABC" , "AAA" , true )
29+ testGt (a , mockA , time .Second , time .Millisecond , true )
30+ testGt (a , mockA , time .Second , time .Second , false )
31+ testGt (a , mockA , time .Second , time .Minute , false )
2832}
2933
3034func testGt (a , mockA * Assertion , v1 , v2 any , isGt bool ) {
@@ -68,6 +72,9 @@ func TestGte(t *testing.T) {
6872 testGte (a , mockA , "ABC" , "BCD" , false )
6973 testGte (a , mockA , "ABC" , "AAA" , true )
7074 testGte (a , mockA , "ABC" , "ABC" , true )
75+ testGte (a , mockA , time .Second , time .Millisecond , true )
76+ testGte (a , mockA , time .Second , time .Second , true )
77+ testGte (a , mockA , time .Second , time .Minute , false )
7178}
7279
7380func testGte (a , mockA * Assertion , v1 , v2 any , isGte bool ) {
@@ -108,6 +115,9 @@ func TestLt(t *testing.T) {
108115 testLt (a , mockA , float32 (1.0 ), 2.0 , true )
109116 testLt (a , mockA , "BCD" , "ABC" , false )
110117 testLt (a , mockA , "AAA" , "ABC" , true )
118+ testLt (a , mockA , time .Millisecond , time .Second , true )
119+ testLt (a , mockA , time .Second , time .Second , false )
120+ testLt (a , mockA , time .Minute , time .Second , false )
111121}
112122
113123func testLt (a , mockA * Assertion , v1 , v2 any , isLt bool ) {
@@ -151,6 +161,9 @@ func TestLte(t *testing.T) {
151161 testLte (a , mockA , "BCD" , "ABC" , false )
152162 testLte (a , mockA , "AAA" , "ABC" , true )
153163 testLte (a , mockA , "ABC" , "ABC" , true )
164+ testLte (a , mockA , time .Millisecond , time .Second , true )
165+ testLte (a , mockA , time .Second , time .Second , true )
166+ testLte (a , mockA , time .Minute , time .Second , false )
154167}
155168
156169func testLte (a , mockA * Assertion , v1 , v2 any , isLte bool ) {
0 commit comments