File tree Expand file tree Collapse file tree 1 file changed +44
-0
lines changed
Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Original file line number Diff line number Diff line change @@ -734,6 +734,50 @@ mod tests {
734734 assert_eq ! ( format( input, & QueryParams :: None , & options) , input) ;
735735 }
736736
737+ #[ test]
738+ fn it_does_not_indent_next_statement_when_max_inline_arguments_is_some_nat ( ) {
739+ let args = [ None , Some ( 0 ) , Some ( 999 ) ] ;
740+
741+ for arg in args {
742+ let input = indoc ! (
743+ "
744+ DROP INDEX IF EXISTS idx_a;
745+
746+ DROP INDEX IF EXISTS idx_b;
747+ "
748+ ) ;
749+ let options = FormatOptions {
750+ max_inline_arguments : arg,
751+ ..Default :: default ( )
752+ } ;
753+ let expected = indoc ! (
754+ "
755+ DROP INDEX IF EXISTS idx_a;
756+
757+ DROP INDEX IF EXISTS idx_b;
758+ "
759+ ) ;
760+
761+ assert_eq ! ( format( input, & QueryParams :: None , & options) , expected) ;
762+
763+ let input = indoc ! (
764+ r#"
765+ -- comment
766+ DROP TABLE IF EXISTS "public"."table_name";
767+ "#
768+ ) ;
769+
770+ let expected = indoc ! (
771+ r#"
772+ -- comment
773+ DROP TABLE IF EXISTS "public"."table_name";
774+ "#
775+ ) ;
776+
777+ assert_eq ! ( format( input, & QueryParams :: None , & options) , expected) ;
778+ }
779+ }
780+
737781 #[ test]
738782 fn it_formats_incomplete_query ( ) {
739783 let input = "SELECT count(" ;
You can’t perform that action at this time.
0 commit comments