test262/test/built-ins/parseInt/S15.1.2.2_A7.3_T3.js

109 lines
3.6 KiB
JavaScript

// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: Return sign * Result(17)
es5id: 15.1.2.2_A7.3_T3
description: Checking algorithm for R = 10
---*/
//CHECK#1
if (parseInt("-1", 10) !== -1) {
$ERROR('#1: parseInt("-1", 10) === -1. Actual: ' + (parseInt("-1", 10)));
}
//CHECK#2
if (parseInt("-10", 10) !== -10) {
$ERROR('#2: parseInt("-10", 10) === -10. Actual: ' + (parseInt("-10", 10)));
}
//CHECK#3
if (parseInt("-100", 10) !== -100) {
$ERROR('#3: parseInt("-100", 10) === -100. Actual: ' + (parseInt("-100", 10)));
}
//CHECK#4
if (parseInt("-1000", 10) !== -1000) {
$ERROR('#4: parseInt("-1000", 10) === -1000. Actual: ' + (parseInt("-1000", 10)));
}
//CHECK#5
if (parseInt("-10000", 10) !== -10000) {
$ERROR('#5: parseInt("-10000", 10) === -10000. Actual: ' + (parseInt("-10000", 10)));
}
//CHECK#6
if (parseInt("-100000", 10) !== -100000) {
$ERROR('#6: parseInt("-100000", 10) === -100000. Actual: ' + (parseInt("-100000", 10)));
}
//CHECK#7
if (parseInt("-1000000", 10) !== -1000000) {
$ERROR('#7: parseInt("-1000000", 10) === -1000000. Actual: ' + (parseInt("-1000000", 10)));
}
//CHECK#8
if (parseInt("-10000000", 10) !== -10000000) {
$ERROR('#8: parseInt("-10000000", 10) === -10000000. Actual: ' + (parseInt("-10000000", 10)));
}
//CHECK#9
if (parseInt("-100000000", 10) !== -100000000) {
$ERROR('#9: parseInt("-100000000", 10) === -100000000. Actual: ' + (parseInt("-100000000", 10)));
}
//CHECK#10
if (parseInt("-1000000000", 10) !== -1000000000) {
$ERROR('#10: parseInt("-1000000000", 10) === -1000000000. Actual: ' + (parseInt("-1000000000", 10)));
}
//CHECK#10
if (parseInt("-10000000000", 10) !== -10000000000) {
$ERROR('#10: parseInt("-10000000000", 10) === -10000000000. Actual: ' + (parseInt("-10000000000", 10)));
}
//CHECK#12
if (parseInt("-100000000000", 10) !== -100000000000) {
$ERROR('#12: parseInt("-100000000000", 10) === -100000000000. Actual: ' + (parseInt("-100000000000", 10)));
}
//CHECK#13
if (parseInt("-1000000000000", 10) !== -1000000000000) {
$ERROR('#13: parseInt("-1000000000000", 10) === -1000000000000. Actual: ' + (parseInt("-1000000000000", 10)));
}
//CHECK#14
if (parseInt("-10000000000000", 10) !== -10000000000000) {
$ERROR('#14: parseInt("-10000000000000", 10) === -10000000000000. Actual: ' + (parseInt("-10000000000000", 10)));
}
//CHECK#15
if (parseInt("-100000000000000", 10) !== -100000000000000) {
$ERROR('#15: parseInt("-100000000000000", 10) === -100000000000000. Actual: ' + (parseInt("-100000000000000", 10)));
}
//CHECK#10
if (parseInt("-1000000000000000", 10) !== -1000000000000000) {
$ERROR('#10: parseInt("-1000000000000000", 10) === -1000000000000000. Actual: ' + (parseInt("-1000000000000000", 10)));
}
//CHECK#17
if (parseInt("-10000000000000000", 10) !== -10000000000000000) {
$ERROR('#17: parseInt("-10000000000000000", 10) === -10000000000000000. Actual: ' + (parseInt("-10000000000000000", 10)));
}
//CHECK#18
if (parseInt("-100000000000000000", 10) !== -100000000000000000) {
$ERROR('#18: parseInt("-100000000000000000", 10) === -100000000000000000. Actual: ' + (parseInt("-100000000000000000", 10)));
}
//CHECK#19
if (parseInt("-1000000000000000000", 10) !== -1000000000000000000) {
$ERROR('#19: parseInt("-1000000000000000000", 10) === -1000000000000000000. Actual: ' + (parseInt("-1000000000000000000", 10)));
}
//CHECK#20
if (parseInt("-10000000000000000000", 10) !== -10000000000000000000) {
$ERROR('#20: parseInt("-10000000000000000000", 10) === -10000000000000000000. Actual: ' + (parseInt("-10000000000000000000", 10)));
}