aharpervc commented on code in PR #1811: URL: https://github.com/apache/datafusion-sqlparser-rs/pull/1811#discussion_r2047240782
########## tests/sqlparser_mssql.rs: ########## @@ -2053,3 +2053,37 @@ fn parse_drop_trigger() { } ); } + +#[test] +fn parse_print() { + let print_string_literal = "PRINT 'Hello, world!'"; + let print_stmt = ms().one_statement_parses_to(print_string_literal, ""); + assert_eq!( + print_stmt, + Statement::Print(PrintStatement { + message: Box::new(Expr::Value( + (Value::SingleQuotedString("Hello, world!".to_string())).with_empty_span() + )), + }) + ); + + let print_national_string = "PRINT N'Hello, ⛄️!'"; + let print_stmt = ms().one_statement_parses_to(print_national_string, ""); + assert_eq!( + print_stmt, + Statement::Print(PrintStatement { + message: Box::new(Expr::Value( + (Value::NationalStringLiteral("Hello, ⛄️!".to_string())).with_empty_span() + )), + }) + ); + + let print_variable = "PRINT @my_variable"; + let print_stmt = ms().one_statement_parses_to(print_variable, ""); + assert_eq!( + print_stmt, + Statement::Print(PrintStatement { + message: Box::new(Expr::Identifier(Ident::new("@my_variable"))), + }) + ); Review Comment: I'm unaware of any requirement, it's just that I don't understand the project testing conventions & I'm trying to follow the patterns already present in the file. I'll switch it over to your suggestion -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org