Browse Source

fix parseInt() testcase radix-16 test

pull/1/head
Sami Vaarala 12 years ago
parent
commit
9819a43b8c
  1. 19
      testcases/test-builtin-global-parseint.js

19
testcases/test-builtin-global-parseint.js

@ -333,19 +333,26 @@ radix 16
print('radix 16');
function testRadix16(x) {
function testRadix16(x, r, arg_count) {
var t;
try {
print(g.parseInt(x));
if (arg_count == 1) {
t = g.parseInt(x);
} else {
t = g.parseInt(x, r);
}
print(t);
} catch (e) {
print(e);
}
}
function radix16Test() {
testRadix16('0xcafe');
testRadix16('-0Xcafe');
testRadix16(' 0xCAfe'); // whitespace + case variation
testRadix16(' -0XCAfe');
testRadix16('0xcafe', undefined, 1);
testRadix16('-0Xcafe', undefined, 1);
testRadix16(' 0xCAfe', undefined, 1); // whitespace + case variation
testRadix16(' -0XCAfe', undefined, 1);
testRadix16('-0xcafe', 16);
testRadix16('0Xcafe', 16);

Loading…
Cancel
Save