Skip to content

Commit 06195b2

Browse files
committed
chore: refactor test_unary_compiler to apply multiple ops
1 parent 1a0f710 commit 06195b2

File tree

15 files changed

+444
-384
lines changed

15 files changed

+444
-384
lines changed

tests/unit/core/compile/sqlglot/expressions/snapshots/test_unary_compiler/test_endswith/no_pattern.sql

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@ WITH `bfcte_0` AS (
55
), `bfcte_1` AS (
66
SELECT
77
*,
8-
ENDS_WITH(`bfcol_0`, 'ab') OR ENDS_WITH(`bfcol_0`, 'cd') AS `bfcol_1`
8+
ENDS_WITH(`bfcol_0`, 'ab') AS `bfcol_1`,
9+
ENDS_WITH(`bfcol_0`, 'ab') OR ENDS_WITH(`bfcol_0`, 'cd') AS `bfcol_2`,
10+
FALSE AS `bfcol_3`
911
FROM `bfcte_0`
1012
)
1113
SELECT
12-
`bfcol_1` AS `string_col`
14+
`bfcol_1` AS `single`,
15+
`bfcol_2` AS `double`,
16+
`bfcol_3` AS `empty`
1317
FROM `bfcte_1`

tests/unit/core/compile/sqlglot/expressions/snapshots/test_unary_compiler/test_endswith/single_pattern.sql

Lines changed: 0 additions & 13 deletions
This file was deleted.

tests/unit/core/compile/sqlglot/expressions/snapshots/test_unary_compiler/test_startswith/no_pattern.sql

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@ WITH `bfcte_0` AS (
55
), `bfcte_1` AS (
66
SELECT
77
*,
8-
STARTS_WITH(`bfcol_0`, 'ab') OR STARTS_WITH(`bfcol_0`, 'cd') AS `bfcol_1`
8+
STARTS_WITH(`bfcol_0`, 'ab') AS `bfcol_1`,
9+
STARTS_WITH(`bfcol_0`, 'ab') OR STARTS_WITH(`bfcol_0`, 'cd') AS `bfcol_2`,
10+
FALSE AS `bfcol_3`
911
FROM `bfcte_0`
1012
)
1113
SELECT
12-
`bfcol_1` AS `string_col`
14+
`bfcol_1` AS `single`,
15+
`bfcol_2` AS `double`,
16+
`bfcol_3` AS `empty`
1317
FROM `bfcte_1`

tests/unit/core/compile/sqlglot/expressions/snapshots/test_unary_compiler/test_startswith/single_pattern.sql

Lines changed: 0 additions & 13 deletions
This file was deleted.

tests/unit/core/compile/sqlglot/expressions/snapshots/test_unary_compiler/test_str_find/out.sql

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,15 @@ WITH `bfcte_0` AS (
55
), `bfcte_1` AS (
66
SELECT
77
*,
8-
INSTR(`bfcol_0`, 'e', 1) - 1 AS `bfcol_1`
8+
INSTR(`bfcol_0`, 'e', 1) - 1 AS `bfcol_1`,
9+
INSTR(`bfcol_0`, 'e', 3) - 1 AS `bfcol_2`,
10+
INSTR(SUBSTRING(`bfcol_0`, 1, 5), 'e') - 1 AS `bfcol_3`,
11+
INSTR(SUBSTRING(`bfcol_0`, 3, 3), 'e') - 1 AS `bfcol_4`
912
FROM `bfcte_0`
1013
)
1114
SELECT
12-
`bfcol_1` AS `string_col`
15+
`bfcol_1` AS `none_none`,
16+
`bfcol_2` AS `start_none`,
17+
`bfcol_3` AS `none_end`,
18+
`bfcol_4` AS `start_end`
1319
FROM `bfcte_1`

tests/unit/core/compile/sqlglot/expressions/snapshots/test_unary_compiler/test_str_find/out_with_end.sql

Lines changed: 0 additions & 13 deletions
This file was deleted.

tests/unit/core/compile/sqlglot/expressions/snapshots/test_unary_compiler/test_str_find/out_with_start.sql

Lines changed: 0 additions & 13 deletions
This file was deleted.

tests/unit/core/compile/sqlglot/expressions/snapshots/test_unary_compiler/test_str_find/out_with_start_and_end.sql

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)