Skip to content

Commit 407a065

Browse files
committed
Fix tests that use OPTION
1 parent d6e7866 commit 407a065

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

test/features/case.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ import { FormatFn } from '../../src/sqlFormatter.js';
55
export default function supportsCase(format: FormatFn) {
66
it('formats CASE ... WHEN with a blank expression', () => {
77
const result = format(
8-
"CASE WHEN option = 'foo' THEN 1 WHEN option = 'bar' THEN 2 WHEN option = 'baz' THEN 3 ELSE 4 END;"
8+
"CASE WHEN opt = 'foo' THEN 1 WHEN opt = 'bar' THEN 2 WHEN opt = 'baz' THEN 3 ELSE 4 END;"
99
);
1010

1111
expect(result).toBe(dedent`
1212
CASE
13-
WHEN option = 'foo' THEN 1
14-
WHEN option = 'bar' THEN 2
15-
WHEN option = 'baz' THEN 3
13+
WHEN opt = 'foo' THEN 1
14+
WHEN opt = 'bar' THEN 2
15+
WHEN opt = 'baz' THEN 3
1616
ELSE 4
1717
END;
1818
`);
@@ -53,11 +53,11 @@ export default function supportsCase(format: FormatFn) {
5353
});
5454

5555
it('recognizes lowercase CASE ... END', () => {
56-
const result = format("case when option = 'foo' then 1 else 2 end;");
56+
const result = format("case when opt = 'foo' then 1 else 2 end;");
5757

5858
expect(result).toBe(dedent`
5959
case
60-
when option = 'foo' then 1
60+
when opt = 'foo' then 1
6161
else 2
6262
end;
6363
`);

test/transactsql.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ describe('TransactSqlFormatter', () => {
138138
`);
139139
});
140140

141-
it('formats SELECT ... OPTIONS ()', () => {
142-
const result = format('SELECT col OPTIONS (MAXRECURSION 5)');
141+
it('formats SELECT ... OPTION ()', () => {
142+
const result = format('SELECT col OPTION (MAXRECURSION 5)');
143143
expect(result).toBe(dedent`
144144
SELECT
145145
col

0 commit comments

Comments
 (0)