Skip to content

Commit 805a120

Browse files
committed
Add new tests
Added tests/jerry/unusual.js to test corner cases Added tests/jerry-test-suite/11/11.08/11.08.06/11.08.06-008.js (a new test of instanceof) Added new floatingpoint test case to tests/jerry/arithmetics-2.js Added new test case to tests/jerry/arithmetics-bignums.js JerryScript-DCO-1.0-Signed-off-by: Csaba Repasi [email protected]
1 parent 74d4742 commit 805a120

File tree

4 files changed

+48
-0
lines changed

4 files changed

+48
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright JS Foundation and other contributors, http://js.foundation
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
var a = null;
16+
var c = a instanceof Object;
17+
assert (!c);

tests/jerry/arithmetics-2.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ assert(c == 210);
2828
c = a / b;
2929
assert(c >= 2.1 - 0.000001 && c <= 2.1 + 0.000001);
3030

31+
assert (0.1 + 0.2 != 0.3);
32+
3133
c = a % b;
3234
assert(c == 1);
3335

tests/jerry/arithmetics-bignums.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,5 @@ assert(big == 2147483649); // overflow on 32bit numbers
2626
assert ((1152921504606846976).toString() === "1152921504606847000")
2727

2828
assert (1.797693134862315808e+308 === Infinity);
29+
30+
assert (9999999999999999 == 10000000000000000);

tests/jerry/unusual.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Copyright JS Foundation and other contributors, http://js.foundation
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
var x = [0];
16+
assert (x == x);
17+
assert (x == !x);
18+
assert (Array(3) == ",,");
19+
20+
assert ([] + [] == "");
21+
assert ([] + {} == "[object Object]");
22+
assert (eval ("{} + []") == 0);
23+
assert (isNaN (eval ("{} + {}")));
24+
assert ({} + [] == "[object Object]");
25+
assert ({} + {} == "[object Object][object Object]");
26+
27+
assert ((! + [] + [] + ![]) === "truefalse");

0 commit comments

Comments
 (0)