Skip to content

Commit

Permalink
Fix corner case with exponential float literal
Browse files Browse the repository at this point in the history
  • Loading branch information
rvanasa committed Jan 9, 2025
1 parent c8229fa commit 0f88bc3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions tests/formatter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,12 @@ public type T = {
expect(await format('@abc')).toStrictEqual('@abc\n');
});

test('scientific notation literals', async () => {
await expectFormatted('let f = 1e2;\n');
await expectFormatted('let f = -1e-2;\n');
await expectFormatted('let f = 1.7976931348623157e+308;\n');
});

test('multi-line text', async () => {
await expectFormatted('"A\nB"\n');
await expectFormatted('" A\n B"\n');
Expand Down
2 changes: 1 addition & 1 deletion wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ serde = { version = "1.0.143", features = ["derive"] }
serde_json = "1.0.83"
wasm-bindgen = { version = "=0.2.82" }
serde-wasm-bindgen = "=0.4.3"
motoko = "0.0.29"
motoko = "0.0.30"

console_error_panic_hook = { version = "0.1.6", optional = true }

Expand Down

0 comments on commit 0f88bc3

Please sign in to comment.