diff options
| author | Teddy Wing | 2018-11-05 03:39:50 +0100 | 
|---|---|---|
| committer | Teddy Wing | 2018-11-05 03:39:50 +0100 | 
| commit | 2495cd60c34061b4e2b383beee6947787388f4cf (patch) | |
| tree | 949010ce4c9c1702891dbe59f67948edb94f978a /moder.c | |
| parent | 0c6ad19a5e1c6b331df04f95b804de35cc2ef52e (diff) | |
| download | dome-key-map-2495cd60c34061b4e2b383beee6947787388f4cf.tar.bz2 | |
parser: Add tests for initial whitespace and comments in mappings file
This broke recently I think. You can no longer have a mappings file that
starts with blank lines or comment lines.
Removing the empty and blank handler in `definitions()` fixes the tests
added by this commit but fails these:
    parser::tests::map_group_empty_input_does_not_fail
    parser::tests::map_group_skipped_input_outputs_default_map_group
Using this diff:
    diff --git a/src/parser.rs b/src/parser.rs
    index 3f3d7b9..d18b56a 100644
    --- a/src/parser.rs
    +++ b/src/parser.rs
    @@ -629,11 +629,11 @@ where
         I: Stream<Item = char>,
         I::Error: ParseError<I::Item, I::Range, I::Position>,
     {
    -    or(
    -        (
    -            blank(),
    -            eof(),
    -        ).map(|_| MapGroup::default()),
    +    // or(
    +    //     (
    +    //         blank(),
    +    //         eof(),
    +    //     ).map(|_| MapGroup::default()),
             (
                 definitions(),
                 eof(),
    @@ -661,8 +661,8 @@ where
                 }
                 map_group
    -        }),
    -    )
    +        })
    +    // )
     }
     fn comment<I>() -> impl Parser<Input = I>
Need to figure out some way to get both sets of tests to pass.
Diffstat (limited to 'moder.c')
0 files changed, 0 insertions, 0 deletions
