@@ -5,13 +5,25 @@ import * as compare from '../../src';
5
5
test ( "decreasing" , t => {
6
6
7
7
8
- t . truthy ( compare . decreasing ( Infinity , 0 ) < 0 , "double <" ) ;
9
- t . truthy ( compare . decreasing ( Infinity , Infinity ) === 0 , "double =" ) ;
10
- t . truthy ( compare . decreasing ( 0 , Infinity ) > 0 , "double >" ) ;
8
+ t . true ( compare . decreasing ( Infinity , 0 ) < 0 , "double <" ) ;
9
+ t . true ( compare . decreasing ( Infinity , Infinity ) === 0 , "double =" ) ;
10
+ t . true ( compare . decreasing ( 0 , Infinity ) > 0 , "double >" ) ;
11
11
12
- t . truthy ( compare . decreasing ( "abc" , "ab" ) < 0 , "string <" ) ;
13
- t . truthy ( compare . decreasing ( "abc" , "abc" ) === 0 , "string =" ) ;
14
- t . truthy ( compare . decreasing ( "ab" , "abc" ) > 0 , "string >" ) ;
12
+ t . true ( compare . decreasing ( "abc" , "ab" ) < 0 , "string <" ) ;
13
+ t . true ( compare . decreasing ( "abc" , "abc" ) === 0 , "string =" ) ;
14
+ t . true ( compare . decreasing ( "ab" , "abc" ) > 0 , "string >" ) ;
15
+
16
+ t . true ( compare . decreasing ( NaN , NaN ) !== 0 , 'NaN != NaN' ) ;
17
+ t . true ( compare . decreasing ( NaN , 0 ) !== 0 , 'NaN != 0' ) ;
18
+ t . true ( compare . decreasing ( 0 , NaN ) !== 0 , '0 != NaN' ) ;
19
+ t . true ( compare . decreasing ( NaN , Infinity ) !== 0 , 'NaN != Infinity' ) ;
20
+ t . true ( compare . decreasing ( Infinity , NaN ) !== 0 , 'Infinity != NaN' ) ;
21
+ t . true ( compare . decreasing ( NaN , - Infinity ) !== 0 , 'NaN != -Infinity' ) ;
22
+ t . true ( compare . decreasing ( - Infinity , NaN ) !== 0 , '-Infinity != NaN' ) ;
23
+
24
+ t . true ( compare . decreasing ( new Date ( 1 ) , new Date ( 1 ) ) !== 0 , "this library is not suitable for date value equality checking" ) ;
25
+ t . true ( compare . decreasing ( new Date ( 0 ) , new Date ( 1 ) ) > 0 , "date >" ) ;
26
+ t . true ( compare . decreasing ( new Date ( 1 ) , new Date ( 0 ) ) < 0 , "date <" ) ;
15
27
16
28
17
29
} ) ;
0 commit comments