@@ -73,20 +73,32 @@ describe('decimal', () => {
73
73
expectNoActionIssue ( action , [ '00' , '01' , '12' , '99' ] ) ;
74
74
} ) ;
75
75
76
+ test ( 'for multiple digits' , ( ) => {
77
+ expectNoActionIssue ( action , [ '1234' , '0123456789' ] ) ;
78
+ } ) ;
79
+
76
80
test ( 'for float numbers' , ( ) => {
77
81
expectNoActionIssue ( action , [ '0.1' , '123.456' ] ) ;
78
82
} ) ;
79
83
80
84
test ( 'for number signs' , ( ) => {
81
- expectNoActionIssue ( action , [ '+1' , '-1' , '+123' , '-123' ] ) ;
85
+ expectNoActionIssue ( action , [ '+1' , '-1' , '+123' , '-123' , '+001' , '-001' ] ) ;
82
86
} ) ;
83
87
84
- test ( 'for float numbers with a number sign' , ( ) => {
88
+ test ( 'for floats with a number sign' , ( ) => {
85
89
expectNoActionIssue ( action , [ '-2.0' , '-52.61' , '+4.0' , '-11.31' ] ) ;
86
90
} ) ;
87
91
88
- test ( 'for multiple digits' , ( ) => {
89
- expectNoActionIssue ( action , [ '0123456789' ] ) ;
92
+ test ( 'for floats starting with a dot' , ( ) => {
93
+ expectNoActionIssue ( action , [ '.6' , '.763' ] ) ;
94
+ } ) ;
95
+
96
+ test ( 'for floats starting with number sign followed by a dot' , ( ) => {
97
+ expectNoActionIssue ( action , [ '-.2' , '-.922' , '+.5' , '+.452' ] ) ;
98
+ } ) ;
99
+
100
+ test ( 'for numbers with leading 0s' , ( ) => {
101
+ expectNoActionIssue ( action , [ '000' , '000123' , '000.123' , '00012.3' ] ) ;
90
102
} ) ;
91
103
} ) ;
92
104
@@ -108,26 +120,18 @@ describe('decimal', () => {
108
120
expectActionIssue ( action , baseIssue , [ ' 1' , '1 ' , ' 1 ' , '1 2' ] ) ;
109
121
} ) ;
110
122
111
- test ( 'for number seperators' , ( ) => {
123
+ test ( 'for invalid seperators' , ( ) => {
112
124
expectActionIssue ( action , baseIssue , [ '1,000' , '1_000' , '1 000' ] ) ;
113
125
} ) ;
114
126
115
- test ( 'for exponential numbers ' , ( ) => {
127
+ test ( 'for scientific notation ' , ( ) => {
116
128
expectActionIssue ( action , baseIssue , [ '1e3' , '1e-3' , '1e+3' ] ) ;
117
129
} ) ;
118
130
119
131
test ( 'for floats ending with a dot' , ( ) => {
120
132
expectActionIssue ( action , baseIssue , [ '1.' , '342.' ] ) ;
121
133
} ) ;
122
134
123
- test ( 'for floats starting with a dot' , ( ) => {
124
- expectActionIssue ( action , baseIssue , [ '.6' , '.763' ] ) ;
125
- } ) ;
126
-
127
- test ( 'for floats starting with number sign followed by a dot' , ( ) => {
128
- expectActionIssue ( action , baseIssue , [ '-.2' , '-.922' , '+.5' , '+.452' ] ) ;
129
- } ) ;
130
-
131
135
test ( 'for floats with multiple dots' , ( ) => {
132
136
expectActionIssue ( action , baseIssue , [
133
137
'1.2.3' ,
0 commit comments