@@ -21,8 +21,10 @@ test('Check if entry will be appended', co.wrap(function* (t) {
21
21
const filePath = path . resolve ( testSrcPath , 'list1.txt' ) ;
22
22
const content = fs . readFileSync ( filePath ) . toString ( ) ;
23
23
24
- t . is ( ( content . match ( / M a r c o / g) || [ ] ) . length , 1 ) ;
25
- t . is ( ( content . match ( / P o l o / g) || [ ] ) . length , 1 ) ;
24
+ t . is ( ( content . match ( / M a r c o 1 / g) || [ ] ) . length , 1 ) ;
25
+ t . is ( ( content . match ( / P o l o 1 / g) || [ ] ) . length , 1 ) ;
26
+ t . is ( ( content . match ( / M a r c o 2 / g) || [ ] ) . length , 1 ) ;
27
+ t . is ( ( content . match ( / P o l o 2 / g) || [ ] ) . length , 1 ) ;
26
28
} ) ) ;
27
29
28
30
test ( 'Check if duplicates get filtered' , co . wrap ( function * ( t ) {
@@ -34,8 +36,10 @@ test('Check if duplicates get filtered', co.wrap(function* (t) {
34
36
const filePath = path . resolve ( testSrcPath , 'list2.txt' ) ;
35
37
const content = fs . readFileSync ( filePath ) . toString ( ) ;
36
38
37
- t . is ( ( content . match ( / M a r c o / g) || [ ] ) . length , 1 ) ;
38
- t . is ( ( content . match ( / P o l o / g) || [ ] ) . length , 1 ) ;
39
+ t . is ( ( content . match ( / M a r c o 1 / g) || [ ] ) . length , 1 ) ;
40
+ t . is ( ( content . match ( / P o l o 1 / g) || [ ] ) . length , 1 ) ;
41
+ t . is ( ( content . match ( / M a r c o 2 / g) || [ ] ) . length , 1 ) ;
42
+ t . is ( ( content . match ( / P o l o 2 / g) || [ ] ) . length , 1 ) ;
39
43
} ) ) ;
40
44
41
45
test ( 'Check if duplicates are kept, if allowed' , co . wrap ( function * ( t ) {
@@ -46,8 +50,10 @@ test('Check if duplicates are kept, if allowed', co.wrap(function* (t) {
46
50
const filePath = path . resolve ( testSrcPath , 'list3.txt' ) ;
47
51
const content = fs . readFileSync ( filePath ) . toString ( ) ;
48
52
49
- t . is ( ( content . match ( / M a r c o / g) || [ ] ) . length , 2 ) ;
50
- t . is ( ( content . match ( / P o l o / g) || [ ] ) . length , 1 ) ;
53
+ t . is ( ( content . match ( / M a r c o 1 / g) || [ ] ) . length , 2 ) ;
54
+ t . is ( ( content . match ( / P o l o 1 / g) || [ ] ) . length , 1 ) ;
55
+ t . is ( ( content . match ( / M a r c o 2 / g) || [ ] ) . length , 2 ) ;
56
+ t . is ( ( content . match ( / P o l o 2 / g) || [ ] ) . length , 1 ) ;
51
57
} ) ) ;
52
58
53
59
test ( 'Check if duplicates are only removed below the pattern' , co . wrap ( function * ( t ) {
@@ -59,6 +65,11 @@ test('Check if duplicates are only removed below the pattern', co.wrap(function*
59
65
const filePath = path . resolve ( testSrcPath , 'list4.txt' ) ;
60
66
const content = fs . readFileSync ( filePath ) . toString ( ) ;
61
67
62
- t . is ( ( content . match ( / P l o p / g) || [ ] ) . length , 2 ) ;
63
- t . is ( ( content . match ( / P o l o / g) || [ ] ) . length , 1 ) ;
68
+ t . is ( ( content . match ( / P l o p 1 / g) || [ ] ) . length , 1 ) ;
69
+ t . is ( ( content . match ( / P o l o 1 / g) || [ ] ) . length , 1 ) ;
70
+ t . is ( ( content . match ( / P l o p 2 / g) || [ ] ) . length , 1 ) ;
71
+ t . is ( ( content . match ( / P o l o 2 / g) || [ ] ) . length , 1 ) ;
72
+
73
+ // there's a plop at the top
74
+ t . is ( ( content . match ( / P l o p / g) || [ ] ) . length , 3 ) ;
64
75
} ) ) ;
0 commit comments