Skip to content

Commit 3cab2b0

Browse files
committed
Move the no-leading-digits test inside supportsNumbers()
1 parent dc11997 commit 3cab2b0

File tree

2 files changed

+8
-15
lines changed

2 files changed

+8
-15
lines changed

test/behavesLikeSqlFormatter.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -279,19 +279,4 @@ export default function behavesLikeSqlFormatter(format: FormatFn) {
279279
tbl;
280280
`);
281281
});
282-
283-
it('supports decimal values without leading digits', () => {
284-
const result = format(
285-
`SELECT employee_id FROM employees WHERE salary > .456 * 1000000 AND bonus < .0000239 * salary;`
286-
);
287-
expect(result).toBe(dedent`
288-
SELECT
289-
employee_id
290-
FROM
291-
employees
292-
WHERE
293-
salary > .456 * 1000000
294-
AND bonus < .0000239 * salary;
295-
`);
296-
});
297282
}

test/features/numbers.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,12 @@ export default function supportsNumbers(format: FormatFn) {
5151
100. * b / SUM(a_s);
5252
`);
5353
});
54+
55+
it('supports decimal values without leading digits', () => {
56+
const result = format(`SELECT .456 AS foo;`);
57+
expect(result).toBe(dedent`
58+
SELECT
59+
.456 AS foo;
60+
`);
61+
});
5462
}

0 commit comments

Comments
 (0)