We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c781c17 commit 21c180eCopy full SHA for 21c180e
crates/pglt_lexer/src/lib.rs
@@ -212,6 +212,22 @@ mod tests {
212
assert_eq!(tokens[1].kind, SyntaxKind::Newline);
213
}
214
215
+ #[test]
216
+ fn test_consecutive_newlines() {
217
+ // Test with multiple consecutive newlines
218
+ #[cfg(windows)]
219
+ let input = "select\r\n\r\n1";
220
+ #[cfg(not(windows))]
221
+ let input = "select\n\n1";
222
+
223
+ let tokens = lex(input).unwrap();
224
225
+ // Check that we have exactly one newline token between "select" and "1"
226
+ assert_eq!(tokens[0].kind, SyntaxKind::Select);
227
+ assert_eq!(tokens[1].kind, SyntaxKind::Newline);
228
+ assert_eq!(tokens[2].kind, SyntaxKind::Iconst);
229
+ }
230
231
#[test]
232
fn test_whitespace_tokens() {
233
let input = "select 1";
0 commit comments