Skip to content

Commit 46ccf3c

Browse files
committed
adding tests for number literals
1 parent 5996443 commit 46ccf3c

3 files changed

Lines changed: 53 additions & 0 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// SPDX-License-Identifier: MIT
2+
pragma solidity 0.8.23;
3+
4+
contract NumberLiteral {
5+
function numbers()public {
6+
2 ether;
7+
5 days;
8+
2.3e5;
9+
1000000e-2;
10+
.1;
11+
1_000_000;
12+
}
13+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`NumberLiteral.sol format 1`] = `
4+
====================================options=====================================
5+
parsers: ["solidity-parse"]
6+
printWidth: 80
7+
| printWidth
8+
=====================================input======================================
9+
// SPDX-License-Identifier: MIT
10+
pragma solidity 0.8.23;
11+
12+
contract NumberLiteral {
13+
function numbers()public {
14+
2 ether;
15+
5 days;
16+
2.3e5;
17+
1000000e-2;
18+
.1;
19+
1_000_000;
20+
}
21+
}
22+
23+
=====================================output=====================================
24+
// SPDX-License-Identifier: MIT
25+
pragma solidity 0.8.23;
26+
27+
contract NumberLiteral {
28+
function numbers() public {
29+
2 ether;
30+
5 days;
31+
2.3e5;
32+
1000000e-2;
33+
.1;
34+
1_000_000;
35+
}
36+
}
37+
38+
================================================================================
39+
`;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
run_spec(import.meta, ['solidity-parse']);

0 commit comments

Comments
 (0)