WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 489fb97

Browse files
committed
Add test case for the tokenizer consuming the character following a question mark
1 parent 571009c commit 489fb97

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

tests/sqlparser_postgres.rs

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use helpers::attached_token::AttachedToken;
2626
use sqlparser::ast::{
2727
DataType, DropBehavior, DropOperator, DropOperatorClass, DropOperatorSignature,
2828
};
29-
use sqlparser::tokenizer::Span;
29+
use sqlparser::tokenizer::{Span, Token, Whitespace};
3030
use test_utils::*;
3131

3232
use sqlparser::ast::*;
@@ -7492,3 +7492,20 @@ fn parse_create_operator_class() {
74927492
)
74937493
.is_err());
74947494
}
7495+
7496+
#[test]
7497+
fn tokenize_question_mark() {
7498+
let sql = "SELECT x ? y";
7499+
pg().tokenizes_to(
7500+
sql,
7501+
vec![
7502+
Token::make_keyword("SELECT"),
7503+
Token::Whitespace(Whitespace::Space),
7504+
Token::make_word("x", None),
7505+
Token::Whitespace(Whitespace::Space),
7506+
Token::Question,
7507+
Token::Whitespace(Whitespace::Space),
7508+
Token::make_word("y", None),
7509+
],
7510+
)
7511+
}

0 commit comments

Comments
 (0)