diff options
| author | Teddy Wing | 2018-11-03 18:24:27 +0100 |
|---|---|---|
| committer | Teddy Wing | 2018-11-03 18:24:27 +0100 |
| commit | c22e695764a8eb45605712fa3ef1ffe7a5beb1df (patch) | |
| tree | e64c27d265c0e9acec6f85bc3a8148a80345337c | |
| parent | e3e0b70d1c7195b460784a333e07019c6b3a19c9 (diff) | |
| download | dome-key-map-c22e695764a8eb45605712fa3ef1ffe7a5beb1df.tar.bz2 | |
map_group_shows_error_in_middle_of_line: Add unexpected token assertion
In addition to asserting the position of the error, also check that it's
the error we expect by looking for an unexpected 'n' token.
| -rw-r--r-- | src/parser.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/parser.rs b/src/parser.rs index 97fbcf0..2e4bf3e 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -1548,13 +1548,17 @@ not-a-kind <play> <Nop> map <not-a-button> <Nop> "; let result = map_group().easy_parse(State::new(text)).map(|t| t.0); + let error = result.unwrap_err(); assert_eq!( - result.unwrap_err().position, + error.position, SourcePosition { line: 2, column: 6, } ); + assert!(error.errors.contains( + &easy::Error::Unexpected('n'.into()), + )); } } |
