@@ -5,7 +5,7 @@ use std::io::{self, BufRead, BufReader};
5
5
use std:: path:: PathBuf ;
6
6
use std:: process:: { self , Command } ;
7
7
use std:: { array, env, mem} ;
8
- use winnow:: ascii:: { space0, space1 } ;
8
+ use winnow:: ascii:: { space0, Caseless } ;
9
9
use winnow:: combinator:: opt;
10
10
use winnow:: Parser ;
11
11
@@ -21,13 +21,7 @@ fn not_done(input: &str) -> bool {
21
21
"//" ,
22
22
opt ( '/' ) ,
23
23
space0,
24
- 'I' ,
25
- space1,
26
- "AM" ,
27
- space1,
28
- "NOT" ,
29
- space1,
30
- "DONE" ,
24
+ Caseless ( "I AM NOT DONE" ) ,
31
25
)
32
26
. parse_next ( & mut & * input)
33
27
. is_ok ( )
@@ -438,15 +432,13 @@ mod test {
438
432
assert ! ( not_done( "/// I AM NOT DONE" ) ) ;
439
433
assert ! ( not_done( "// I AM NOT DONE" ) ) ;
440
434
assert ! ( not_done( "/// I AM NOT DONE" ) ) ;
441
- assert ! ( not_done( "// I AM NOT DONE" ) ) ;
442
- assert ! ( not_done( "// I AM NOT DONE" ) ) ;
443
- assert ! ( not_done( "// I AM NOT DONE" ) ) ;
444
435
assert ! ( not_done( "// I AM NOT DONE " ) ) ;
445
436
assert ! ( not_done( "// I AM NOT DONE!" ) ) ;
437
+ assert ! ( not_done( "// I am not done" ) ) ;
438
+ assert ! ( not_done( "// i am NOT done" ) ) ;
446
439
447
440
assert ! ( !not_done( "I AM NOT DONE" ) ) ;
448
441
assert ! ( !not_done( "// NOT DONE" ) ) ;
449
442
assert ! ( !not_done( "DONE" ) ) ;
450
- assert ! ( !not_done( "// i am not done" ) ) ;
451
443
}
452
444
}
0 commit comments