Skip to content

Commit

Permalink
fix invalid testcases
Browse files Browse the repository at this point in the history
  • Loading branch information
lemonadern committed Nov 20, 2024
1 parent e5b24e9 commit 644b881
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 17 deletions.
3 changes: 3 additions & 0 deletions crates/uroborosql-fmt/testfiles/dst/select/order_by.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ order by
col asc -- 昇順
, long_col desc nulls first -- 降順
, null_col nulls first -- NULL先
;
select
*
from
Expand All @@ -15,6 +16,7 @@ order by
, /* after comma */
t.bar2
, t.bar3
;
select
*
from
Expand All @@ -24,3 +26,4 @@ order by
/* before comma */
, t.bar2
, t.bar3
;
15 changes: 13 additions & 2 deletions crates/uroborosql-fmt/testfiles/dst/select/unary.sql
Original file line number Diff line number Diff line change
@@ -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
;
5 changes: 3 additions & 2 deletions crates/uroborosql-fmt/testfiles/src/select/order_by.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@ select col from tab
order by col asc -- 昇順
, long_col desc nulls first -- 降順
, null_col nulls first -- NULL先
;

select * from foo t
order by
t.bar1
,
/* after comma */
t.bar2
, t.bar3
, t.bar3;

select * from foo t
order by
t.bar1
/* before comma */
, t.bar2
, t.bar3
, t.bar3;
26 changes: 13 additions & 13 deletions crates/uroborosql-fmt/testfiles/src/select/unary.sql
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit 644b881

Please sign in to comment.