-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add more testcases for no-trailing-zeros
- Loading branch information
Showing
14 changed files
with
236 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,3 +18,5 @@ | |
- "f": .0 | ||
- "g": +1.0 | ||
- "h": -1.0 | ||
- "i": +.0 | ||
- "j": -.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
82 changes: 82 additions & 0 deletions
82
tests/fixtures/rules/no-trailing-zeros/invalid/exponential-test-errors.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
[ | ||
{ | ||
"message": "Trailing zeros are not allowed, fix to `1.2e20`.", | ||
"line": 3, | ||
"column": 3 | ||
}, | ||
{ | ||
"message": "Trailing zeros are not allowed, fix to `.2e20`.", | ||
"line": 5, | ||
"column": 3 | ||
}, | ||
{ | ||
"message": "Trailing zeros are not allowed, fix to `1e20`.", | ||
"line": 6, | ||
"column": 3 | ||
}, | ||
{ | ||
"message": "Trailing zeros are not allowed, fix to `0e20`.", | ||
"line": 7, | ||
"column": 3 | ||
}, | ||
{ | ||
"message": "Trailing zeros are not allowed, fix to `+1e20`.", | ||
"line": 8, | ||
"column": 3 | ||
}, | ||
{ | ||
"message": "Trailing zeros are not allowed, fix to `-1e20`.", | ||
"line": 9, | ||
"column": 3 | ||
}, | ||
{ | ||
"message": "Trailing zeros are not allowed, fix to `+0e20`.", | ||
"line": 10, | ||
"column": 3 | ||
}, | ||
{ | ||
"message": "Trailing zeros are not allowed, fix to `-0e20`.", | ||
"line": 11, | ||
"column": 3 | ||
}, | ||
{ | ||
"message": "Trailing zeros are not allowed, fix to `1.2E20`.", | ||
"line": 13, | ||
"column": 3 | ||
}, | ||
{ | ||
"message": "Trailing zeros are not allowed, fix to `.2E20`.", | ||
"line": 15, | ||
"column": 3 | ||
}, | ||
{ | ||
"message": "Trailing zeros are not allowed, fix to `1E20`.", | ||
"line": 16, | ||
"column": 3 | ||
}, | ||
{ | ||
"message": "Trailing zeros are not allowed, fix to `0E20`.", | ||
"line": 17, | ||
"column": 3 | ||
}, | ||
{ | ||
"message": "Trailing zeros are not allowed, fix to `+1E20`.", | ||
"line": 18, | ||
"column": 3 | ||
}, | ||
{ | ||
"message": "Trailing zeros are not allowed, fix to `-1E20`.", | ||
"line": 19, | ||
"column": 3 | ||
}, | ||
{ | ||
"message": "Trailing zeros are not allowed, fix to `+0E20`.", | ||
"line": 20, | ||
"column": 3 | ||
}, | ||
{ | ||
"message": "Trailing zeros are not allowed, fix to `-0E20`.", | ||
"line": 21, | ||
"column": 3 | ||
} | ||
] |
21 changes: 21 additions & 0 deletions
21
tests/fixtures/rules/no-trailing-zeros/invalid/exponential-test-input.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# {"options": []} | ||
- 1.23e20 | ||
- 1.20e20 | ||
- .23e20 | ||
- .20e20 | ||
- 1.0e20 | ||
- .0e20 | ||
- +1.0e20 | ||
- -1.0e20 | ||
- +.0e20 | ||
- -.0e20 | ||
- 1.23E20 | ||
- 1.20E20 | ||
- .23E20 | ||
- .20E20 | ||
- 1.0E20 | ||
- .0E20 | ||
- +1.0E20 | ||
- -1.0E20 | ||
- +.0E20 | ||
- -.0E20 |
21 changes: 21 additions & 0 deletions
21
tests/fixtures/rules/no-trailing-zeros/invalid/exponential-test-output.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# no-trailing-zeros/invalid/exponential-test-input.yml | ||
- 1.23e20 | ||
- 1.2e20 | ||
- .23e20 | ||
- .2e20 | ||
- 1e20 | ||
- 0e20 | ||
- +1e20 | ||
- -1e20 | ||
- +0e20 | ||
- -0e20 | ||
- 1.23E20 | ||
- 1.2E20 | ||
- .23E20 | ||
- .2E20 | ||
- 1E20 | ||
- 0E20 | ||
- +1E20 | ||
- -1E20 | ||
- +0E20 | ||
- -0E20 |
17 changes: 17 additions & 0 deletions
17
tests/fixtures/rules/no-trailing-zeros/invalid/yaml1_1-test-errors.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[ | ||
{ | ||
"message": "Trailing zeros are not allowed, fix to `1_2.3`.", | ||
"line": 4, | ||
"column": 4 | ||
}, | ||
{ | ||
"message": "Trailing zeros are not allowed, fix to `1_2.3`.", | ||
"line": 5, | ||
"column": 4 | ||
}, | ||
{ | ||
"message": "Trailing zeros are not allowed, fix to `1_2.3_4e30`.", | ||
"line": 6, | ||
"column": 4 | ||
} | ||
] |
6 changes: 6 additions & 0 deletions
6
tests/fixtures/rules/no-trailing-zeros/invalid/yaml1_1-test-input.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# {"options": []} | ||
%YAML 1.1 | ||
--- | ||
a: 1_2.3_0 | ||
b: 1_2.3_0_0 | ||
c: 1_2.3_4_0__0_e30 |
6 changes: 6 additions & 0 deletions
6
tests/fixtures/rules/no-trailing-zeros/invalid/yaml1_1-test-output.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# no-trailing-zeros/invalid/yaml1_1-test-input.yml | ||
%YAML 1.1 | ||
--- | ||
a: 1_2.3 | ||
b: 1_2.3 | ||
c: 1_2.3_4e30 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,3 +18,5 @@ | |
- "f": ".0" | ||
- "g": "+1.0" | ||
- "h": "-1.0" | ||
- "i": "+.0" | ||
- "j": "-.0" |
11 changes: 11 additions & 0 deletions
11
tests/fixtures/rules/no-trailing-zeros/valid/exponential-test-input.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# {"options": []} | ||
- 1.23e20 | ||
- "1.20e20" | ||
- .23e20 | ||
- .2e20 | ||
- "1.0e20" | ||
- ".0e20" | ||
- "+1.0e20" | ||
- "-1.0e20" | ||
- "+.0e20" | ||
- "-.0e20" |
5 changes: 5 additions & 0 deletions
5
tests/fixtures/rules/no-trailing-zeros/valid/yaml1_1-test-input.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# {"options": []} | ||
%YAML 1.1 | ||
--- | ||
a: 1_2.3_4 | ||
b: 1_2.3_4e30 |