Skip to content

Commit eafec7d

Browse files
committed
Move commaPosition:tabular test to designated section
1 parent d24778d commit eafec7d

File tree

1 file changed

+19
-24
lines changed

1 file changed

+19
-24
lines changed

test/options/commaPosition.ts

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -73,30 +73,6 @@ export default function supportsCommaPosition(format: FormatFn) {
7373
);
7474
});
7575

76-
it('should work with comma position tabular and comment', () => {
77-
const result = format(
78-
`
79-
SELECT
80-
alpha ,
81-
beta,--comment
82-
delta ,
83-
epsilon ,
84-
iota
85-
`,
86-
{ commaPosition: 'tabular' }
87-
);
88-
expect(result).toBe(
89-
dedent(`
90-
SELECT
91-
alpha ,
92-
beta , --comment
93-
delta ,
94-
epsilon,
95-
iota
96-
`)
97-
);
98-
});
99-
10076
it('works with larger indent', () => {
10177
const result = format(
10278
'SELECT alpha, MAX(beta), delta AS d, epsilon FROM gamma GROUP BY alpha, delta, epsilon',
@@ -155,6 +131,25 @@ export default function supportsCommaPosition(format: FormatFn) {
155131
);
156132
});
157133

134+
it('handles comments after commas', () => {
135+
const result = format(
136+
`SELECT alpha, beta,--comment1
137+
delta, epsilon, iota --comment2
138+
`,
139+
{ commaPosition: 'tabular' }
140+
);
141+
expect(result).toBe(
142+
dedent(`
143+
SELECT
144+
alpha ,
145+
beta , --comment1
146+
delta ,
147+
epsilon,
148+
iota --comment2
149+
`)
150+
);
151+
});
152+
158153
it('is not effected by indent size', () => {
159154
const result = format(
160155
'SELECT alpha, MAX(beta), delta AS d, epsilon FROM gamma GROUP BY alpha, delta, epsilon',

0 commit comments

Comments
 (0)