Skip to content

Commit

Permalink
Check that En space tests fail.
Browse files Browse the repository at this point in the history
  • Loading branch information
ratmice committed Aug 14, 2022
1 parent 6a1ea79 commit 7635044
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lrlex/src/lib/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1321,7 +1321,8 @@ a\[\]a 'aboxa'
LRNonStreamingLexerDef::<DefaultLexeme<u8>, u8>::from_str(&src).ok();
}

/// Test with various /// [Pattern_White_Space](https://unicode.org/reports/tr31/) separators.
/// Test that we accept various [Pattern_White_Space](https://unicode.org/reports/tr31/)
/// separators and reject other unicode whitespace separators.
#[test]
fn test_various_whitespace() {
let src = "
Expand All @@ -1330,6 +1331,11 @@ a\[\]a 'aboxa'
%%
A ;
B 'b'
C 'c'
D 'A'";
LRNonStreamingLexerDef::<DefaultLexeme<u8>, u8>::from_str(src).ok();
assert!(LRNonStreamingLexerDef::<DefaultLexeme<u8>, u8>::from_str(src).is_ok());
// En Space isn't part of Pattern_White_Space.
let src = "%S X Y";
LRNonStreamingLexerDef::<DefaultLexeme<u8>, u8>::from_str(src).expect_error_at_line_col(src, LexErrorKind::InvalidStartStateName, 1, 4);
let src = "%S X ";
LRNonStreamingLexerDef::<DefaultLexeme<u8>, u8>::from_str(src).expect_error_at_line_col(src, LexErrorKind::UnknownDeclaration, 1, 5);
}
}

0 comments on commit 7635044

Please sign in to comment.