diff --git a/lrlex/src/lib/parser.rs b/lrlex/src/lib/parser.rs index 6d6d65c9b..9917314ba 100644 --- a/lrlex/src/lib/parser.rs +++ b/lrlex/src/lib/parser.rs @@ -1321,7 +1321,8 @@ a\[\]a 'aboxa' LRNonStreamingLexerDef::, 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 = " @@ -1330,6 +1331,11 @@ a\[\]a 'aboxa' %% A ; B 'b'
C 'c'
D 'A'"; - LRNonStreamingLexerDef::, u8>::from_str(src).ok(); + assert!(LRNonStreamingLexerDef::, u8>::from_str(src).is_ok()); + // En Space isn't part of Pattern_White_Space. + let src = "%S X Y"; + LRNonStreamingLexerDef::, u8>::from_str(src).expect_error_at_line_col(src, LexErrorKind::InvalidStartStateName, 1, 4); + let src = "%S X "; + LRNonStreamingLexerDef::, u8>::from_str(src).expect_error_at_line_col(src, LexErrorKind::UnknownDeclaration, 1, 5); } }