Skip to content

Commit 7a8da0a

Browse files
committed
Improve unit-test.
1 parent f382ecd commit 7a8da0a

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

test/test-utils.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,18 @@ function prototypeString() {
150150
str = '';
151151
assert.ok(str.parseInt() === 0, 'string.parseInt(): ' + str);
152152

153+
str = 'Abc 334';
154+
assert.ok(str.parseInt2() === 334, 'string.parseInt2(): ' + str);
155+
156+
str = 'Abc 334.33';
157+
assert.ok(str.parseFloat2() === 334.33, 'string.parseFloat2(): ' + str);
158+
159+
str = '';
160+
assert.ok(str.parseInt2() === 0, 'string.parseInt2(): ' + str);
161+
162+
str = '';
163+
assert.ok(str.parseFloat2() === 0, 'string.parseFloat2(): ' + str);
164+
153165
str = '255.50';
154166
assert.ok(str.parseFloat() === 255.5, 'string.parseFloat(): ' + str);
155167

0 commit comments

Comments
 (0)