From 644b88114a4ba6b81a71de0c29efa34c8e8306d0 Mon Sep 17 00:00:00 2001 From: lemonadern Date: Wed, 20 Nov 2024 19:32:32 +0900 Subject: [PATCH] fix invalid testcases --- .../testfiles/dst/select/order_by.sql | 3 +++ .../testfiles/dst/select/unary.sql | 15 +++++++++-- .../testfiles/src/select/order_by.sql | 5 ++-- .../testfiles/src/select/unary.sql | 26 +++++++++---------- 4 files changed, 32 insertions(+), 17 deletions(-) diff --git a/crates/uroborosql-fmt/testfiles/dst/select/order_by.sql b/crates/uroborosql-fmt/testfiles/dst/select/order_by.sql index 5e686bc..0a4a88c 100644 --- a/crates/uroborosql-fmt/testfiles/dst/select/order_by.sql +++ b/crates/uroborosql-fmt/testfiles/dst/select/order_by.sql @@ -6,6 +6,7 @@ order by col asc -- 昇順 , long_col desc nulls first -- 降順 , null_col nulls first -- NULL先 +; select * from @@ -15,6 +16,7 @@ order by , /* after comma */ t.bar2 , t.bar3 +; select * from @@ -24,3 +26,4 @@ order by /* before comma */ , t.bar2 , t.bar3 +; diff --git a/crates/uroborosql-fmt/testfiles/dst/select/unary.sql b/crates/uroborosql-fmt/testfiles/dst/select/unary.sql index 8cda271..c0c2c14 100644 --- a/crates/uroborosql-fmt/testfiles/dst/select/unary.sql +++ b/crates/uroborosql-fmt/testfiles/dst/select/unary.sql @@ -1,26 +1,37 @@ select +5 as positive_value +; select +5 as positive_value +; select -10 as negative_value +; select -10 as negative_value +; select not true as not_true +; select ~5 as bitwise_not +; select ~5 as bitwise_not +; select |/25 as square_root +; select |/25 as square_root +; +-- select @-5 as absolute_value; : PostgreSQLでは、`@-5` と書くと `@-` が一つのトークンとして扱われるため無効なSQLになる select @-5 as absolute_value -select - @-5 as absolute_value +; select ||/8 as cube_root +; select ||/8 as cube_root +; diff --git a/crates/uroborosql-fmt/testfiles/src/select/order_by.sql b/crates/uroborosql-fmt/testfiles/src/select/order_by.sql index ef15a45..9df444c 100644 --- a/crates/uroborosql-fmt/testfiles/src/select/order_by.sql +++ b/crates/uroborosql-fmt/testfiles/src/select/order_by.sql @@ -2,6 +2,7 @@ select col from tab order by col asc -- 昇順 , long_col desc nulls first -- 降順 , null_col nulls first -- NULL先 +; select * from foo t order by @@ -9,11 +10,11 @@ order by , /* after comma */ t.bar2 -, t.bar3 +, t.bar3; select * from foo t order by t.bar1 /* before comma */ , t.bar2 -, t.bar3 +, t.bar3; diff --git a/crates/uroborosql-fmt/testfiles/src/select/unary.sql b/crates/uroborosql-fmt/testfiles/src/select/unary.sql index 17c1122..40bf88d 100644 --- a/crates/uroborosql-fmt/testfiles/src/select/unary.sql +++ b/crates/uroborosql-fmt/testfiles/src/select/unary.sql @@ -1,19 +1,19 @@ -select +5 as positive_value -select + 5 as positive_value +select +5 as positive_value; +select + 5 as positive_value; -select -10 as negative_value -select - 10 as negative_value +select -10 as negative_value; +select - 10 as negative_value; -select not true as not_true +select not true as not_true; -select ~5 as bitwise_not -select ~ 5 as bitwise_not +select ~5 as bitwise_not; +select ~ 5 as bitwise_not; -select |/25 as square_root -select |/ 25 as square_root +select |/25 as square_root; +select |/ 25 as square_root; -select @-5 as absolute_value -select @ -5 as absolute_value +-- select @-5 as absolute_value; : PostgreSQLでは、`@-5` と書くと `@-` が一つのトークンとして扱われるため無効なSQLになる +select @ -5 as absolute_value; -select ||/8 as cube_root -select ||/ 8 as cube_root +select ||/8 as cube_root; +select ||/ 8 as cube_root;