1
- import { describe , expect , it } from " bun:test" ;
2
- import { Comparator } from " ./comparator" ;
1
+ import { describe , expect , it } from ' bun:test' ;
2
+ import { Comparator } from ' ./comparator' ;
3
3
4
- describe ( " Comparator" , ( ) => {
5
- it ( " should compare with default comparator function" , ( ) => {
4
+ describe ( ' Comparator' , ( ) => {
5
+ it ( ' should compare with default comparator function' , ( ) => {
6
6
// Arrange
7
7
const comparator = new Comparator ( ) ;
8
8
9
9
// Act and Assert
10
10
expect ( comparator . equal ( 0 , 0 ) ) . toBeTruthy ( ) ;
11
11
expect ( comparator . equal ( 1 , 0 ) ) . toBeFalsy ( ) ;
12
- expect ( comparator . equal ( "a" , "a" ) ) . toBeTruthy ( ) ;
12
+ expect ( comparator . equal ( 'a' , 'a' ) ) . toBeTruthy ( ) ;
13
13
expect ( comparator . lessThan ( 1 , 2 ) ) . toBeTruthy ( ) ;
14
14
expect ( comparator . lessThan ( - 1 , 2 ) ) . toBeTruthy ( ) ;
15
- expect ( comparator . lessThan ( "a" , "b" ) ) . toBeTruthy ( ) ;
16
- expect ( comparator . lessThan ( "a" , "ab" ) ) . toBeTruthy ( ) ;
15
+ expect ( comparator . lessThan ( 'a' , 'b' ) ) . toBeTruthy ( ) ;
16
+ expect ( comparator . lessThan ( 'a' , 'ab' ) ) . toBeTruthy ( ) ;
17
17
expect ( comparator . lessThan ( 10 , 2 ) ) . toBeFalsy ( ) ;
18
18
expect ( comparator . lessThanOrEqual ( 1 , 1 ) ) . toBeTruthy ( ) ;
19
19
expect ( comparator . lessThanOrEqual ( 0 , 0 ) ) . toBeTruthy ( ) ;
@@ -24,7 +24,7 @@ describe("Comparator", () => {
24
24
expect ( comparator . greaterThanOrEqual ( 0 , 10 ) ) . toBeFalsy ( ) ;
25
25
} ) ;
26
26
27
- it ( " should compare with custom comparator function" , ( ) => {
27
+ it ( ' should compare with custom comparator function' , ( ) => {
28
28
// Arrange
29
29
const comparator = new Comparator ( ( a : string , b : string ) => {
30
30
if ( a . length === b . length ) return 0 ;
@@ -33,11 +33,11 @@ describe("Comparator", () => {
33
33
} ) ;
34
34
35
35
// Act and Assert
36
- expect ( comparator . equal ( "a" , "b" ) ) . toBeTruthy ( ) ;
37
- expect ( comparator . equal ( "a" , "" ) ) . toBeFalsy ( ) ;
38
- expect ( comparator . lessThan ( "b" , "aa" ) ) . toBeTruthy ( ) ;
39
- expect ( comparator . greaterThanOrEqual ( "a" , "aa" ) ) . toBeFalsy ( ) ;
40
- expect ( comparator . greaterThanOrEqual ( "aa" , "a" ) ) . toBeTruthy ( ) ;
41
- expect ( comparator . greaterThanOrEqual ( "a" , "a" ) ) . toBeTruthy ( ) ;
36
+ expect ( comparator . equal ( 'a' , 'b' ) ) . toBeTruthy ( ) ;
37
+ expect ( comparator . equal ( 'a' , '' ) ) . toBeFalsy ( ) ;
38
+ expect ( comparator . lessThan ( 'b' , 'aa' ) ) . toBeTruthy ( ) ;
39
+ expect ( comparator . greaterThanOrEqual ( 'a' , 'aa' ) ) . toBeFalsy ( ) ;
40
+ expect ( comparator . greaterThanOrEqual ( 'aa' , 'a' ) ) . toBeTruthy ( ) ;
41
+ expect ( comparator . greaterThanOrEqual ( 'a' , 'a' ) ) . toBeTruthy ( ) ;
42
42
} ) ;
43
43
} ) ;
0 commit comments