Skip to content

Commit

Permalink
Move the no-leading-digits test inside supportsNumbers()
Browse files Browse the repository at this point in the history
  • Loading branch information
nene committed Oct 25, 2024
1 parent dc11997 commit 3cab2b0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 deletions.
15 changes: 0 additions & 15 deletions test/behavesLikeSqlFormatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,19 +279,4 @@ export default function behavesLikeSqlFormatter(format: FormatFn) {
tbl;
`);
});

it('supports decimal values without leading digits', () => {
const result = format(
`SELECT employee_id FROM employees WHERE salary > .456 * 1000000 AND bonus < .0000239 * salary;`
);
expect(result).toBe(dedent`
SELECT
employee_id
FROM
employees
WHERE
salary > .456 * 1000000
AND bonus < .0000239 * salary;
`);
});
}
8 changes: 8 additions & 0 deletions test/features/numbers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,12 @@ export default function supportsNumbers(format: FormatFn) {
100. * b / SUM(a_s);
`);
});

it('supports decimal values without leading digits', () => {
const result = format(`SELECT .456 AS foo;`);
expect(result).toBe(dedent`
SELECT
.456 AS foo;
`);
});
}

0 comments on commit 3cab2b0

Please sign in to comment.