| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Flags: --harmony-types | 5 // Flags: --harmony-types |
| 6 | 6 |
| 7 | 7 |
| 8 load("test/mjsunit/harmony/typesystem/typegen.js"); | 8 load("test/mjsunit/harmony/typesystem/typegen.js"); |
| 9 | 9 |
| 10 | 10 |
| 11 // In all the following functions, the size parameter (positive integer) | 11 // In all the following functions, the size parameter (positive integer) |
| 12 // denotes how many test cases will be tried. The variable test_size | 12 // denotes how many test cases will be tried. The variable test_size |
| 13 // controls execution time of this test. It should not be too high. | 13 // controls execution time of this test. It should not be too high. |
| 14 let test_size = 1000; | 14 let test_size = 1000; |
| 15 | 15 |
| 16 | 16 |
| 17 (function TestPrimaryTypes(size) { | 17 (function TestPrimaryTypes(size) { |
| 18 Test(size, [ | 18 Test(size, [ |
| 19 new TestGen(4, ValidPrimaryTypes, [CheckValid], true), | 19 new TestGen(4, ValidPrimaryTypes, [CheckValidType], true), |
| 20 new TestGen(1, InvalidPrimaryTypes, [CheckInvalid], true) | 20 new TestGen(1, InvalidPrimaryTypes, [CheckInvalidType], true) |
| 21 ]); | 21 ]); |
| 22 })(test_size); | 22 })(test_size); |
| 23 | 23 |
| 24 | 24 |
| 25 (function TestIntersectionTypes(size) { | 25 (function TestIntersectionTypes(size) { |
| 26 Test(size, [ | 26 Test(size, [ |
| 27 new TestGen(4, ValidIntersectionTypes, [CheckValid], true), | 27 new TestGen(4, ValidIntersectionTypes, [CheckValidType], true), |
| 28 new TestGen(1, InvalidIntersectionTypes, [CheckInvalid], true) | 28 new TestGen(1, InvalidIntersectionTypes, [CheckInvalidType], true) |
| 29 ]); | 29 ]); |
| 30 })(test_size); | 30 })(test_size); |
| 31 | 31 |
| 32 | 32 |
| 33 (function TestUnionTypes(size) { | 33 (function TestUnionTypes(size) { |
| 34 Test(size, [ | 34 Test(size, [ |
| 35 new TestGen(4, ValidUnionTypes, [CheckValid], true), | 35 new TestGen(4, ValidUnionTypes, [CheckValidType], true), |
| 36 new TestGen(1, InvalidUnionTypes, [CheckInvalid], true) | 36 new TestGen(1, InvalidUnionTypes, [CheckInvalidType], true) |
| 37 ]); | 37 ]); |
| 38 })(test_size); | 38 })(test_size); |
| 39 | 39 |
| 40 | 40 |
| 41 (function TestFunctionAndConstructorTypes(size) { | 41 (function TestFunctionAndConstructorTypes(size) { |
| 42 Test(size, [ | 42 Test(size, [ |
| 43 new TestGen(4, ValidFunctionTypes, [CheckValid], false), | 43 new TestGen(4, ValidFunctionTypes, [CheckValidType], false), |
| 44 new TestGen(1, InvalidFunctionTypes, [CheckInvalid], false), | 44 new TestGen(1, InvalidFunctionTypes, [CheckInvalidType], false), |
| 45 new TestGen(4, ValidFunctionTypes, [CheckValid], true), | 45 new TestGen(4, ValidFunctionTypes, [CheckValidType], true), |
| 46 new TestGen(1, InvalidFunctionTypes, [CheckInvalid], true) | 46 new TestGen(1, InvalidFunctionTypes, [CheckInvalidType], true) |
| 47 ]); | 47 ]); |
| 48 })(test_size); | 48 })(test_size); |
| OLD | NEW |