From d45758536e4bddb931304d71af2d812ca7c444d5 Mon Sep 17 00:00:00 2001 From: swx1282997 Date: Mon, 8 Apr 2024 16:36:37 +0800 Subject: [PATCH] =?UTF-8?q?aottest=E5=85=B3=E4=BA=8Eassert=5Fequal?= =?UTF-8?q?=E8=BF=98=E5=8E=9F(6277=206327=206380)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: shiminnan@huawei.com --- test/aottest/BUILD.gn | 70 +- test/aottest/array/BUILD.gn | 2 +- test/aottest/array/array.ts | 12 +- test/aottest/array/expect_output.txt | 18 + test/aottest/array_foreach_inline/BUILD.gn | 2 +- .../array_foreach_inline.ts | 17 +- .../array_foreach_inline/expect_output.txt | 25 + test/aottest/ashr/BUILD.gn | 2 +- test/aottest/ashr/ashr.ts | 18 +- test/aottest/ashr/expect_output.txt | 21 + test/aottest/bc_builder/BUILD.gn | 2 +- test/aottest/bc_builder/expect_output.txt | 14 + test/aottest/binaryop_special_value/BUILD.gn | 2 +- .../binaryop_special_value.ts | 686 +++++++++--------- .../binaryop_special_value/expect_output.txt | 374 ++++++++++ test/aottest/bind/BUILD.gn | 2 +- test/aottest/bind/bind.ts | 18 +- test/aottest/bind/expect_output.txt | 24 + test/aottest/builtinmath/BUILD.gn | 2 +- test/aottest/builtinmath/builtinmath.ts | 72 +- test/aottest/builtinmath/expect_output.txt | 49 ++ test/aottest/call_same_bytecode_func/BUILD.gn | 2 +- .../call_same_bytecode_func.ts | 5 +- .../call_same_bytecode_func/expect_output.txt | 17 + test/aottest/callithisrange/BUILD.gn | 2 +- test/aottest/callithisrange/expect_output.txt | 14 + test/aottest/calls/BUILD.gn | 2 +- test/aottest/calls/calls.ts | 204 ++---- test/aottest/calls/expect_output.txt | 95 +++ test/aottest/class_method_signature/BUILD.gn | 2 +- .../class_method_signature.ts | 40 +- .../class_method_signature/expect_output.txt | 32 + test/aottest/classstatic/BUILD.gn | 2 +- test/aottest/classstatic/classstatic.ts | 32 +- test/aottest/classstatic/expect_output.txt | 30 + test/aottest/closeiterator/BUILD.gn | 2 +- test/aottest/closeiterator/expect_output.txt | 14 + test/aottest/compiler_test/BUILD.gn | 2 +- test/aottest/compiler_test/compiler_test.ts | 13 +- test/aottest/compiler_test/expect_output.txt | 17 + test/aottest/constpool/BUILD.gn | 2 +- test/aottest/constpool/constpool.ts | 6 +- test/aottest/constpool/expect_output.txt | 15 + test/aottest/continue_from_finally/BUILD.gn | 2 +- .../continue_from_finally.ts | 5 +- .../continue_from_finally/expect_output.txt | 14 + test/aottest/copyrestargs/BUILD.gn | 2 +- test/aottest/copyrestargs/copyrestargs.ts | 10 +- test/aottest/copyrestargs/expect_output.txt | 18 + test/aottest/createarray_meta_data/BUILD.gn | 2 +- .../createarray_meta_data.ts | 3 +- .../createarray_meta_data/expect_output.txt | 14 + .../pgo_expect_output.txt | 14 + test/aottest/createarrayimm16/BUILD.gn | 2 +- .../createarrayimm16/createarrayimm16.ts | 20 +- .../createarrayimm16/expect_output.txt | 53 ++ test/aottest/createarraywithbuffer/BUILD.gn | 2 +- .../createarraywithbuffer.ts | 62 +- .../createarraywithbuffer/expect_output.txt | 45 ++ test/aottest/createemptyarray/BUILD.gn | 2 +- .../createemptyarray/createemptyarray.ts | 7 +- .../createemptyarray/expect_output.txt | 15 + test/aottest/createemptyobject/BUILD.gn | 2 +- .../createemptyobject/createemptyobject.ts | 7 +- .../createemptyobject/expect_output.txt | 15 + test/aottest/creategeneratorobj/BUILD.gn | 2 +- .../creategeneratorobj/expect_output.txt | 14 + test/aottest/createiterresultobj/BUILD.gn | 2 +- .../createiterresultobj.ts | 8 +- .../createiterresultobj/expect_output.txt | 16 + .../aottest/createobjecthavingmethod/BUILD.gn | 2 +- .../createobjecthavingmethod.ts | 4 +- .../expect_output.txt | 14 + test/aottest/createobjectwithbuffer/BUILD.gn | 2 +- .../createobjectwithbuffer.ts | 8 +- .../createobjectwithbuffer/expect_output.txt | 16 + .../createobjectwithexcludedkeys/BUILD.gn | 2 +- .../createobjectwithexcludedkeys.ts | 11 +- .../expect_output.txt | 18 + test/aottest/createregexpwithliteral/BUILD.gn | 2 +- .../createregexpwithliteral.ts | 7 +- .../createregexpwithliteral/expect_output.txt | 15 + test/aottest/dec/BUILD.gn | 2 +- test/aottest/dec/dec.ts | 9 +- test/aottest/dec/expect_output.txt | 16 + test/aottest/default_supers/BUILD.gn | 2 +- test/aottest/default_supers/default_supers.ts | 3 +- test/aottest/default_supers/expect_output.txt | 18 + test/aottest/defineasyncfunc/BUILD.gn | 2 +- .../aottest/defineasyncfunc/expect_output.txt | 15 + test/aottest/defineclass/BUILD.gn | 2 +- test/aottest/defineclass/expect_output.txt | 14 + test/aottest/defineclasswithbuffer/BUILD.gn | 2 +- .../defineclasswithbuffer.ts | 12 +- .../defineclasswithbuffer/expect_output.txt | 18 + test/aottest/definefunc/BUILD.gn | 2 +- test/aottest/definefunc/definefunc.ts | 3 +- test/aottest/definefunc/expect_output.txt | 14 + .../aottest/definefunc_variable_args/BUILD.gn | 2 +- .../definefunc_variable_args.ts | 5 +- .../expect_output.txt | 15 + 101 files changed, 1793 insertions(+), 804 deletions(-) create mode 100644 test/aottest/array/expect_output.txt create mode 100644 test/aottest/array_foreach_inline/expect_output.txt create mode 100644 test/aottest/ashr/expect_output.txt create mode 100644 test/aottest/bc_builder/expect_output.txt create mode 100644 test/aottest/binaryop_special_value/expect_output.txt create mode 100644 test/aottest/bind/expect_output.txt create mode 100644 test/aottest/builtinmath/expect_output.txt create mode 100644 test/aottest/call_same_bytecode_func/expect_output.txt create mode 100644 test/aottest/callithisrange/expect_output.txt create mode 100644 test/aottest/calls/expect_output.txt create mode 100644 test/aottest/class_method_signature/expect_output.txt create mode 100644 test/aottest/classstatic/expect_output.txt create mode 100644 test/aottest/closeiterator/expect_output.txt create mode 100644 test/aottest/compiler_test/expect_output.txt create mode 100644 test/aottest/constpool/expect_output.txt create mode 100644 test/aottest/continue_from_finally/expect_output.txt create mode 100644 test/aottest/copyrestargs/expect_output.txt create mode 100644 test/aottest/createarray_meta_data/expect_output.txt create mode 100644 test/aottest/createarray_meta_data/pgo_expect_output.txt create mode 100644 test/aottest/createarrayimm16/expect_output.txt create mode 100644 test/aottest/createarraywithbuffer/expect_output.txt create mode 100644 test/aottest/createemptyarray/expect_output.txt create mode 100644 test/aottest/createemptyobject/expect_output.txt create mode 100644 test/aottest/creategeneratorobj/expect_output.txt create mode 100644 test/aottest/createiterresultobj/expect_output.txt create mode 100644 test/aottest/createobjecthavingmethod/expect_output.txt create mode 100644 test/aottest/createobjectwithbuffer/expect_output.txt create mode 100644 test/aottest/createobjectwithexcludedkeys/expect_output.txt create mode 100644 test/aottest/createregexpwithliteral/expect_output.txt create mode 100644 test/aottest/dec/expect_output.txt create mode 100644 test/aottest/default_supers/expect_output.txt create mode 100644 test/aottest/defineasyncfunc/expect_output.txt create mode 100644 test/aottest/defineclass/expect_output.txt create mode 100644 test/aottest/defineclasswithbuffer/expect_output.txt create mode 100644 test/aottest/definefunc/expect_output.txt create mode 100644 test/aottest/definefunc_variable_args/expect_output.txt diff --git a/test/aottest/BUILD.gn b/test/aottest/BUILD.gn index 239376d844..aca1a03fd4 100644 --- a/test/aottest/BUILD.gn +++ b/test/aottest/BUILD.gn @@ -58,6 +58,9 @@ group("ark_aot_js_assert_test") { group("ark_aot_ts_test") { testonly = true test_list = [ + "array", + "array_foreach_inline", + "ashr", "asyncgenerator", "asyncgeneratormultiloop", "asyncgeneratorrest", @@ -65,6 +68,38 @@ group("ark_aot_ts_test") { "async_env", "await", "await_loop", + "bc_builder", + "bind", + "binaryop_special_value", + "builtinmath", + "call_same_bytecode_func", + "callithisrange", + "calls", + "classstatic", + "class_method_signature", + "closeiterator", + "compiler_test", + "constpool", + "continue_from_finally", + "copyrestargs", + "createarray_meta_data", + "createarrayimm16", + "createarraywithbuffer", + "createemptyarray", + "createemptyobject", + "creategeneratorobj", + "createiterresultobj", + "createobjecthavingmethod", + "createobjectwithbuffer", + "createobjectwithexcludedkeys", + "createregexpwithliteral", + "dec", + "default_supers", + "defineasyncfunc", + "defineclasswithbuffer", + "defineclass", + "definefunc", + "definefunc_variable_args", "definegeneratorfunc", "definegettersetterbyvalue", "definemethod", @@ -308,41 +343,6 @@ group("ark_aot_ts_assert_test") { "add", "and", "array_bounds_check_elimination", - "array", - "array_foreach_inline", - "ashr", - "bind", - "binaryop_special_value", - "bc_builder", - "builtinmath", - "call_same_bytecode_func", - "callithisrange", - "calls", - "classstatic", - "class_method_signature", - "closeiterator", - "compiler_test", - "constpool", - "continue_from_finally", - "copyrestargs", - "createarray_meta_data", - "createarrayimm16", - "createarraywithbuffer", - "createemptyarray", - "createemptyobject", - "creategeneratorobj", - "createiterresultobj", - "createobjecthavingmethod", - "createobjectwithbuffer", - "createobjectwithexcludedkeys", - "createregexpwithliteral", - "dec", - "default_supers", - "defineasyncfunc", - "defineclasswithbuffer", - "defineclass", - "definefunc", - "definefunc_variable_args", ] foreach(test, assert_test_list) { deps += [ "${test}:${test}AotAssertAction" ] diff --git a/test/aottest/array/BUILD.gn b/test/aottest/array/BUILD.gn index 7978b2aaa0..c7ec4de51f 100644 --- a/test/aottest/array/BUILD.gn +++ b/test/aottest/array/BUILD.gn @@ -13,6 +13,6 @@ import("//arkcompiler/ets_runtime/test/test_helper.gni") -host_aot_assert_test_action("array") { +host_aot_test_action("array") { deps = [] } diff --git a/test/aottest/array/array.ts b/test/aottest/array/array.ts index d48764dfd9..0c3ea9634c 100644 --- a/test/aottest/array/array.ts +++ b/test/aottest/array/array.ts @@ -13,12 +13,12 @@ * limitations under the License. */ -declare function assert_equal(a: Object, b: Object):void; +declare function print(arg:any):string; let a = [] let l = a.push(1) -assert_equal(l, 1) +print(l) l = a.push(1, 2, 3, 4, 5) -assert_equal(l, 6) +print(l) for (let i = 0; i < 100; i++) { a.push(i) @@ -27,7 +27,7 @@ for (let i = 0; i < 100; i++) { let c = [1, 2, 3, 4] a.push(...c) -assert_equal(a.length, 110) +print(a.length) let b = [] b.push(1, 2, 3, 4) @@ -35,5 +35,5 @@ b.push(1, 2, 3) b.push(1, 2) b.push(1) b.push() -assert_equal(Object.values(b), [1, 2, 3, 4, 1, 2, 3, 1, 2, 1]) -assert_equal(b.length, 10) +print(Object.values(b)) +print(b.length) diff --git a/test/aottest/array/expect_output.txt b/test/aottest/array/expect_output.txt new file mode 100644 index 0000000000..4c3ea11575 --- /dev/null +++ b/test/aottest/array/expect_output.txt @@ -0,0 +1,18 @@ +# Copyright (c) 2022 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +1 +6 +110 +1,2,3,4,1,2,3,1,2,1 +10 diff --git a/test/aottest/array_foreach_inline/BUILD.gn b/test/aottest/array_foreach_inline/BUILD.gn index 28bbdf2b52..884ecf315e 100644 --- a/test/aottest/array_foreach_inline/BUILD.gn +++ b/test/aottest/array_foreach_inline/BUILD.gn @@ -13,7 +13,7 @@ import("//arkcompiler/ets_runtime/test/test_helper.gni") -host_aot_assert_test_action("array_foreach_inline") { +host_aot_test_action("array_foreach_inline") { deps = [] is_enable_opt_inlining = true is_enable_native_inline = true diff --git a/test/aottest/array_foreach_inline/array_foreach_inline.ts b/test/aottest/array_foreach_inline/array_foreach_inline.ts index 2cd774bead..4c1da5d75b 100644 --- a/test/aottest/array_foreach_inline/array_foreach_inline.ts +++ b/test/aottest/array_foreach_inline/array_foreach_inline.ts @@ -13,30 +13,21 @@ * limitations under the License. */ -declare function assert_equal(a: Object, b: Object):void; let array1:numeber[] = [4, 5, 6]; -const expectedArray1 = [4, 5, 6]; -let i = 0; array1.forEach((element) => { - assert_equal(element, expectedArray1[i]); - i++; + print(element) }); -i = 0; array1.forEach((element) => { array1[array1.length] = array1.length - assert_equal(element, expectedArray1[i]); - i++; + print(element) }); -const expectedArray2 = [4, 6, 3, 4, 5]; -i = 0; array1.forEach((element) => { delete array1[1]; - assert_equal(element, expectedArray2[i]); - i++; + print(element) }); -assert_equal(array1.length, 6) +print(array1.length) diff --git a/test/aottest/array_foreach_inline/expect_output.txt b/test/aottest/array_foreach_inline/expect_output.txt new file mode 100644 index 0000000000..abb8e0aa61 --- /dev/null +++ b/test/aottest/array_foreach_inline/expect_output.txt @@ -0,0 +1,25 @@ +# Copyright (c) 2023 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +4 +5 +6 +4 +5 +6 +4 +6 +3 +4 +5 +6 diff --git a/test/aottest/ashr/BUILD.gn b/test/aottest/ashr/BUILD.gn index 1a08c322d0..33b3ea9e0b 100644 --- a/test/aottest/ashr/BUILD.gn +++ b/test/aottest/ashr/BUILD.gn @@ -13,6 +13,6 @@ import("//arkcompiler/ets_runtime/test/test_helper.gni") -host_aot_assert_test_action("ashr") { +host_aot_test_action("ashr") { deps = [] } diff --git a/test/aottest/ashr/ashr.ts b/test/aottest/ashr/ashr.ts index 9de5083eb1..d75c491e8a 100644 --- a/test/aottest/ashr/ashr.ts +++ b/test/aottest/ashr/ashr.ts @@ -13,45 +13,45 @@ * limitations under the License. */ -declare function assert_equal(a: Object, b: Object):void; +declare function print(str:any):string; var x1 = 16; var y1 = 1; var r1 = x1 >>> y1; -assert_equal(r1, 8); +print(r1); var x2 = 16.8; var y2 = 1; var r2 = x2 >>> y2; -assert_equal(r2, 8); +print(r2); var x3 = 16; var y3 = 1.8; var r3 = x3 >>> y3; -assert_equal(r3, 8); +print(r3); var x4 = 16.8; var y4 = 1.8; var r4 = x4 >>> y4; -assert_equal(r4, 8); +print(r4); var x5:any = "16"; var y5:number = 1; var r5 = x5 >>> y5; -assert_equal(r5, 8); +print(r5); var x6 = -16; var y6 = 1; var r6 = x6 >>> y6; -assert_equal(r6, 2147483640); +print(r6); var x7 = 16; var y7 = -1; var r7 = x7 >>> y7; -assert_equal(r7, 0); +print(r7); var x8 = 4294967295.1; var y8 = 0; var r8 = x8 >>> y8; -assert_equal(r8, 4294967295); +print(r8); // not supported type: string, bigint diff --git a/test/aottest/ashr/expect_output.txt b/test/aottest/ashr/expect_output.txt new file mode 100644 index 0000000000..34ffe3c13c --- /dev/null +++ b/test/aottest/ashr/expect_output.txt @@ -0,0 +1,21 @@ +# Copyright (c) 2022 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +8 +8 +8 +8 +8 +2147483640 +0 +4294967295 diff --git a/test/aottest/bc_builder/BUILD.gn b/test/aottest/bc_builder/BUILD.gn index de15394cac..ae4aebd9ff 100644 --- a/test/aottest/bc_builder/BUILD.gn +++ b/test/aottest/bc_builder/BUILD.gn @@ -13,6 +13,6 @@ import("//arkcompiler/ets_runtime/test/test_helper.gni") -host_aot_assert_test_action("bc_builder") { +host_aot_test_action("bc_builder") { deps = [] } diff --git a/test/aottest/bc_builder/expect_output.txt b/test/aottest/bc_builder/expect_output.txt new file mode 100644 index 0000000000..11e347853e --- /dev/null +++ b/test/aottest/bc_builder/expect_output.txt @@ -0,0 +1,14 @@ +# Copyright (c) 2023 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +2 diff --git a/test/aottest/binaryop_special_value/BUILD.gn b/test/aottest/binaryop_special_value/BUILD.gn index c23f2f1156..da8fc2daf0 100644 --- a/test/aottest/binaryop_special_value/BUILD.gn +++ b/test/aottest/binaryop_special_value/BUILD.gn @@ -13,6 +13,6 @@ import("//arkcompiler/ets_runtime/test/test_helper.gni") -host_aot_assert_test_action("binaryop_special_value") { +host_aot_test_action("binaryop_special_value") { deps = [] } diff --git a/test/aottest/binaryop_special_value/binaryop_special_value.ts b/test/aottest/binaryop_special_value/binaryop_special_value.ts index 9bc94ca2fe..3d8a9ae6a6 100644 --- a/test/aottest/binaryop_special_value/binaryop_special_value.ts +++ b/test/aottest/binaryop_special_value/binaryop_special_value.ts @@ -14,8 +14,6 @@ */ declare function print(arg:any):string; -declare function assert_true(condition: boolean):void; -declare function assert_equal(a: Object, b: Object):void; let undf: any = undefined; let intNum: number = 5; @@ -26,399 +24,399 @@ let nullValue: any = null; // int op undefined print("=====int op undefined=====") -assert_true(isNaN(intNum + undf)); -assert_true(isNaN(intNum - undf)); -assert_true(isNaN(intNum * undf)); -assert_true(isNaN(intNum / undf)); -assert_true(isNaN(intNum % undf)); -assert_equal(intNum < undf, falseValue); -assert_equal(intNum <= undf, falseValue); -assert_equal(intNum > undf, falseValue); -assert_equal(intNum >= undf, falseValue); -assert_equal(intNum == undf, falseValue); -assert_equal(intNum === undf, falseValue); -assert_equal(intNum != undf, trueValue); -assert_equal(intNum !== undf, trueValue); -assert_equal(intNum << undf, 5); -assert_equal(intNum >> undf, 5); -assert_equal(intNum >>> undf, 5); -assert_equal(intNum | undf, 5); -assert_equal(intNum ^ undf, 5); +print(intNum + undf); +print(intNum - undf); +print(intNum * undf); +print(intNum / undf); +print(intNum % undf); +print(intNum < undf); +print(intNum <= undf); +print(intNum > undf); +print(intNum >= undf); +print(intNum == undf); +print(intNum === undf); +print(intNum != undf); +print(intNum !== undf); +print(intNum << undf); +print(intNum >> undf); +print(intNum >>> undf); +print(intNum | undf); +print(intNum ^ undf); // double op undefined print("=====double op undefined=====") -assert_true(isNaN(doubleNum + undf)); -assert_true(isNaN(doubleNum - undf)); -assert_true(isNaN(doubleNum * undf)); -assert_true(isNaN(doubleNum / undf)); -assert_true(isNaN(doubleNum % undf)); -assert_equal(doubleNum < undf, falseValue); -assert_equal(doubleNum <= undf, falseValue); -assert_equal(doubleNum > undf, falseValue); -assert_equal(doubleNum >= undf, falseValue); -assert_equal(doubleNum == undf, falseValue); -assert_equal(doubleNum === undf, falseValue); -assert_equal(doubleNum != undf, trueValue); -assert_equal(doubleNum !== undf, trueValue); -assert_equal(doubleNum << undf, 1); -assert_equal(doubleNum >> undf, 1); -assert_equal(doubleNum >>> undf, 1); -assert_equal(doubleNum | undf, 1); -assert_equal(doubleNum ^ undf, 1); +print(doubleNum + undf); +print(doubleNum - undf); +print(doubleNum * undf); +print(doubleNum / undf); +print(doubleNum % undf); +print(doubleNum < undf); +print(doubleNum <= undf); +print(doubleNum > undf); +print(doubleNum >= undf); +print(doubleNum == undf); +print(doubleNum === undf); +print(doubleNum != undf); +print(doubleNum !== undf); +print(doubleNum << undf); +print(doubleNum >> undf); +print(doubleNum >>> undf); +print(doubleNum | undf); +print(doubleNum ^ undf); // false op undefined print("=====false op undefined=====") -assert_true(isNaN(falseValue + undf)); -assert_true(isNaN(falseValue - undf)); -assert_true(isNaN(falseValue * undf)); -assert_true(isNaN(falseValue / undf)); -assert_true(isNaN(falseValue % undf)); -assert_equal(falseValue < undf, falseValue); -assert_equal(falseValue <= undf, falseValue); -assert_equal(falseValue > undf, falseValue); -assert_equal(falseValue >= undf, falseValue); -assert_equal(falseValue == undf, falseValue); -assert_equal(falseValue === undf, falseValue); -assert_equal(falseValue != undf, trueValue); -assert_equal(falseValue !== undf, trueValue); -assert_equal(falseValue << undf, 0); -assert_equal(falseValue >> undf, 0); -assert_equal(falseValue >>> undf, 0); -assert_equal(falseValue | undf, 0); -assert_equal(falseValue ^ undf, 0); +print(falseValue + undf); +print(falseValue - undf); +print(falseValue * undf); +print(falseValue / undf); +print(falseValue % undf); +print(falseValue < undf); +print(falseValue <= undf); +print(falseValue > undf); +print(falseValue >= undf); +print(falseValue == undf); +print(falseValue === undf); +print(falseValue != undf); +print(falseValue !== undf); +print(falseValue << undf); +print(falseValue >> undf); +print(falseValue >>> undf); +print(falseValue | undf); +print(falseValue ^ undf); // true op undefined print("=====true op undefined=====") -assert_true(isNaN(trueValue + undf)); -assert_true(isNaN(trueValue - undf)); -assert_true(isNaN(trueValue * undf)); -assert_true(isNaN(trueValue / undf)); -assert_true(isNaN(trueValue % undf)); -assert_equal(trueValue < undf, falseValue); -assert_equal(trueValue <= undf, falseValue); -assert_equal(trueValue > undf, falseValue); -assert_equal(trueValue >= undf, falseValue); -assert_equal(trueValue == undf, falseValue); -assert_equal(trueValue === undf, falseValue); -assert_equal(trueValue != undf, trueValue); -assert_equal(trueValue !== undf, trueValue); -assert_equal(trueValue << undf, 1); -assert_equal(trueValue >> undf, 1); -assert_equal(trueValue >>> undf, 1); -assert_equal(trueValue | undf, 1); -assert_equal(trueValue ^ undf, 1); +print(trueValue + undf); +print(trueValue - undf); +print(trueValue * undf); +print(trueValue / undf); +print(trueValue % undf); +print(trueValue < undf); +print(trueValue <= undf); +print(trueValue > undf); +print(trueValue >= undf); +print(trueValue == undf); +print(trueValue === undf); +print(trueValue != undf); +print(trueValue !== undf); +print(trueValue << undf); +print(trueValue >> undf); +print(trueValue >>> undf); +print(trueValue | undf); +print(trueValue ^ undf); // null op undefined print("=====null op undefined=====") -assert_true(isNaN(nullValue + undf)); -assert_true(isNaN(nullValue - undf)); -assert_true(isNaN(nullValue * undf)); -assert_true(isNaN(nullValue / undf)); -assert_true(isNaN(nullValue % undf)); -assert_equal(nullValue < undf, falseValue); -assert_equal(nullValue <= undf, falseValue); -assert_equal(nullValue > undf, falseValue); -assert_equal(nullValue >= undf, falseValue); -assert_equal(nullValue == undf, trueValue); -assert_equal(nullValue === undf, falseValue); -assert_equal(nullValue != undf, falseValue); -assert_equal(nullValue !== undf, trueValue); -assert_equal(nullValue << undf, 0); -assert_equal(nullValue >> undf, 0); -assert_equal(nullValue >>> undf, 0); -assert_equal(nullValue | undf, 0); -assert_equal(nullValue ^ undf, 0); +print(nullValue + undf); +print(nullValue - undf); +print(nullValue * undf); +print(nullValue / undf); +print(nullValue % undf); +print(nullValue < undf); +print(nullValue <= undf); +print(nullValue > undf); +print(nullValue >= undf); +print(nullValue == undf); +print(nullValue === undf); +print(nullValue != undf); +print(nullValue !== undf); +print(nullValue << undf); +print(nullValue >> undf); +print(nullValue >>> undf); +print(nullValue | undf); +print(nullValue ^ undf); // int op null print("=====int op null=====") -assert_equal(intNum + nullValue, 5); -assert_equal(intNum - nullValue, 5); -assert_equal(intNum * nullValue, 0); -assert_equal(intNum / nullValue, Infinity); -assert_true(isNaN(intNum % nullValue)); -assert_equal(intNum < nullValue, falseValue); -assert_equal(intNum <= nullValue, falseValue); -assert_equal(intNum > nullValue, trueValue); -assert_equal(intNum >= nullValue, trueValue); -assert_equal(intNum == nullValue, falseValue); -assert_equal(intNum === nullValue, falseValue); -assert_equal(intNum != nullValue, trueValue); -assert_equal(intNum !== nullValue, trueValue); -assert_equal(intNum << nullValue, 5); -assert_equal(intNum >> nullValue, 5); -assert_equal(intNum >>> nullValue, 5); -assert_equal(intNum | nullValue, 5); -assert_equal(intNum ^ nullValue, 5); +print(intNum + nullValue); +print(intNum - nullValue); +print(intNum * nullValue); +print(intNum / nullValue); +print(intNum % nullValue); +print(intNum < nullValue); +print(intNum <= nullValue); +print(intNum > nullValue); +print(intNum >= nullValue); +print(intNum == nullValue); +print(intNum === nullValue); +print(intNum != nullValue); +print(intNum !== nullValue); +print(intNum << nullValue); +print(intNum >> nullValue); +print(intNum >>> nullValue); +print(intNum | nullValue); +print(intNum ^ nullValue); // double op null print("=====double op null=====") -assert_equal(doubleNum + nullValue, 1.1); -assert_equal(doubleNum - nullValue, 1.1); -assert_equal(doubleNum * nullValue, 0); -assert_equal(doubleNum / nullValue, Infinity); -assert_true(isNaN(doubleNum % nullValue)); -assert_equal(doubleNum < nullValue, falseValue); -assert_equal(doubleNum <= nullValue, falseValue); -assert_equal(doubleNum > nullValue, trueValue); -assert_equal(doubleNum >= nullValue, trueValue); -assert_equal(doubleNum == nullValue, falseValue); -assert_equal(doubleNum === nullValue, falseValue); -assert_equal(doubleNum != nullValue, trueValue); -assert_equal(doubleNum !== nullValue, trueValue); -assert_equal(doubleNum << nullValue, 1); -assert_equal(doubleNum >> nullValue, 1); -assert_equal(doubleNum >>> nullValue, 1); -assert_equal(doubleNum | nullValue, 1); -assert_equal(doubleNum ^ nullValue, 1); +print(doubleNum + nullValue); +print(doubleNum - nullValue); +print(doubleNum * nullValue); +print(doubleNum / nullValue); +print(doubleNum % nullValue); +print(doubleNum < nullValue); +print(doubleNum <= nullValue); +print(doubleNum > nullValue); +print(doubleNum >= nullValue); +print(doubleNum == nullValue); +print(doubleNum === nullValue); +print(doubleNum != nullValue); +print(doubleNum !== nullValue); +print(doubleNum << nullValue); +print(doubleNum >> nullValue); +print(doubleNum >>> nullValue); +print(doubleNum | nullValue); +print(doubleNum ^ nullValue); // false op null print("=====false op null=====") -assert_equal(falseValue + nullValue, 0); -assert_equal(falseValue - nullValue, 0); -assert_equal(falseValue * nullValue, 0); -assert_true(isNaN(falseValue / nullValue)); -assert_true(isNaN(falseValue % nullValue)); -assert_equal(falseValue < nullValue, falseValue); -assert_equal(falseValue <= nullValue, trueValue); -assert_equal(falseValue > nullValue, falseValue); -assert_equal(falseValue >= nullValue, trueValue); -assert_equal(falseValue == nullValue, falseValue); -assert_equal(falseValue === nullValue, falseValue); -assert_equal(falseValue != nullValue, trueValue); -assert_equal(falseValue !== nullValue, trueValue); -assert_equal(falseValue << nullValue, 0); -assert_equal(falseValue >> nullValue, 0); -assert_equal(falseValue >>> nullValue, 0); -assert_equal(falseValue | nullValue, 0); -assert_equal(falseValue ^ nullValue, 0); +print(falseValue + nullValue); +print(falseValue - nullValue); +print(falseValue * nullValue); +print(falseValue / nullValue); +print(falseValue % nullValue); +print(falseValue < nullValue); +print(falseValue <= nullValue); +print(falseValue > nullValue); +print(falseValue >= nullValue); +print(falseValue == nullValue); +print(falseValue === nullValue); +print(falseValue != nullValue); +print(falseValue !== nullValue); +print(falseValue << nullValue); +print(falseValue >> nullValue); +print(falseValue >>> nullValue); +print(falseValue | nullValue); +print(falseValue ^ nullValue); // true op null print("=====true op null=====") -assert_equal(trueValue + nullValue, 1); -assert_equal(trueValue - nullValue, 1); -assert_equal(trueValue * nullValue, 0); -assert_equal(trueValue / nullValue, Infinity); -assert_true(isNaN(trueValue % nullValue)); -assert_equal(trueValue < nullValue, falseValue); -assert_equal(trueValue <= nullValue, falseValue); -assert_equal(trueValue > nullValue, trueValue); -assert_equal(trueValue >= nullValue, trueValue); -assert_equal(trueValue == nullValue, falseValue); -assert_equal(trueValue === nullValue, falseValue); -assert_equal(trueValue != nullValue, trueValue); -assert_equal(trueValue !== nullValue, trueValue); -assert_equal(trueValue << nullValue, 1); -assert_equal(trueValue >> nullValue, 1); -assert_equal(trueValue >>> nullValue, 1); -assert_equal(trueValue | nullValue, 1); -assert_equal(trueValue ^ nullValue, 1); +print(trueValue + nullValue); +print(trueValue - nullValue); +print(trueValue * nullValue); +print(trueValue / nullValue); +print(trueValue % nullValue); +print(trueValue < nullValue); +print(trueValue <= nullValue); +print(trueValue > nullValue); +print(trueValue >= nullValue); +print(trueValue == nullValue); +print(trueValue === nullValue); +print(trueValue != nullValue); +print(trueValue !== nullValue); +print(trueValue << nullValue); +print(trueValue >> nullValue); +print(trueValue >>> nullValue); +print(trueValue | nullValue); +print(trueValue ^ nullValue); // int op false print("=====int op false=====") -assert_equal(intNum + falseValue, 5); -assert_equal(intNum - falseValue, 5); -assert_equal(intNum * falseValue, 0); -assert_equal(intNum / falseValue, Infinity); -assert_true(isNaN(intNum % falseValue)); -assert_equal(intNum < falseValue, falseValue); -assert_equal(intNum <= falseValue, falseValue); -assert_equal(intNum > falseValue, trueValue); -assert_equal(intNum >= falseValue, trueValue); -assert_equal(intNum == falseValue, falseValue); -assert_equal(intNum === falseValue, falseValue); -assert_equal(intNum != falseValue, trueValue); -assert_equal(intNum !== falseValue, trueValue); -assert_equal(intNum << falseValue, 5); -assert_equal(intNum >> falseValue, 5); -assert_equal(intNum >>> falseValue, 5); -assert_equal(intNum | falseValue, 5); -assert_equal(intNum ^ falseValue, 5); +print(intNum + falseValue); +print(intNum - falseValue); +print(intNum * falseValue); +print(intNum / falseValue); +print(intNum % falseValue); +print(intNum < falseValue); +print(intNum <= falseValue); +print(intNum > falseValue); +print(intNum >= falseValue); +print(intNum == falseValue); +print(intNum === falseValue); +print(intNum != falseValue); +print(intNum !== falseValue); +print(intNum << falseValue); +print(intNum >> falseValue); +print(intNum >>> falseValue); +print(intNum | falseValue); +print(intNum ^ falseValue); // double op false print("=====double op false=====") -assert_equal(doubleNum + falseValue, 1.1); -assert_equal(doubleNum - falseValue, 1.1); -assert_equal(doubleNum * falseValue, 0); -assert_equal(doubleNum / falseValue, Infinity); -assert_true(isNaN(doubleNum % falseValue)); -assert_equal(doubleNum < falseValue, falseValue); -assert_equal(doubleNum <= falseValue, falseValue); -assert_equal(doubleNum > falseValue, trueValue); -assert_equal(doubleNum >= falseValue, trueValue); -assert_equal(doubleNum == falseValue, falseValue); -assert_equal(doubleNum === falseValue, falseValue); -assert_equal(doubleNum != falseValue, trueValue); -assert_equal(doubleNum !== falseValue, trueValue); -assert_equal(doubleNum << falseValue, 1); -assert_equal(doubleNum >> falseValue, 1); -assert_equal(doubleNum >>> falseValue, 1); -assert_equal(doubleNum | falseValue, 1); -assert_equal(doubleNum ^ falseValue, 1); +print(doubleNum + falseValue); +print(doubleNum - falseValue); +print(doubleNum * falseValue); +print(doubleNum / falseValue); +print(doubleNum % falseValue); +print(doubleNum < falseValue); +print(doubleNum <= falseValue); +print(doubleNum > falseValue); +print(doubleNum >= falseValue); +print(doubleNum == falseValue); +print(doubleNum === falseValue); +print(doubleNum != falseValue); +print(doubleNum !== falseValue); +print(doubleNum << falseValue); +print(doubleNum >> falseValue); +print(doubleNum >>> falseValue); +print(doubleNum | falseValue); +print(doubleNum ^ falseValue); // true op false print("=====true op false=====") -assert_equal(trueValue + falseValue, 1); -assert_equal(trueValue - falseValue, 1); -assert_equal(trueValue * falseValue, 0); -assert_equal(trueValue / falseValue, Infinity); -assert_true(isNaN(trueValue % falseValue)); -assert_equal(trueValue < falseValue, falseValue); -assert_equal(trueValue <= falseValue, falseValue); -assert_equal(trueValue > falseValue, trueValue); -assert_equal(trueValue >= falseValue, trueValue); -assert_equal(trueValue == falseValue, falseValue); -assert_equal(trueValue === falseValue, falseValue); -assert_equal(trueValue != falseValue, trueValue); -assert_equal(trueValue !== falseValue, trueValue); -assert_equal(trueValue << falseValue, 1); -assert_equal(trueValue >> falseValue, 1); -assert_equal(trueValue >>> falseValue, 1); -assert_equal(trueValue | falseValue, 1); -assert_equal(trueValue ^ falseValue, 1); +print(trueValue + falseValue); +print(trueValue - falseValue); +print(trueValue * falseValue); +print(trueValue / falseValue); +print(trueValue % falseValue); +print(trueValue < falseValue); +print(trueValue <= falseValue); +print(trueValue > falseValue); +print(trueValue >= falseValue); +print(trueValue == falseValue); +print(trueValue === falseValue); +print(trueValue != falseValue); +print(trueValue !== falseValue); +print(trueValue << falseValue); +print(trueValue >> falseValue); +print(trueValue >>> falseValue); +print(trueValue | falseValue); +print(trueValue ^ falseValue); // int op true print("=====int op true=====") -assert_equal(intNum + trueValue, 6); -assert_equal(intNum - trueValue, 4); -assert_equal(intNum * trueValue, 5); -assert_equal(intNum / trueValue, 5); -assert_equal(intNum % trueValue, 0); -assert_equal(intNum < trueValue, falseValue); -assert_equal(intNum <= trueValue, falseValue); -assert_equal(intNum > trueValue, trueValue); -assert_equal(intNum >= trueValue, trueValue); -assert_equal(intNum == trueValue, falseValue); -assert_equal(intNum === trueValue, falseValue); -assert_equal(intNum != trueValue, trueValue); -assert_equal(intNum !== trueValue, trueValue); -assert_equal(intNum << trueValue, 10); -assert_equal(intNum >> trueValue, 2); -assert_equal(intNum >>> trueValue, 2); -assert_equal(intNum | trueValue, 5); -assert_equal(intNum ^ trueValue, 4); +print(intNum + trueValue); +print(intNum - trueValue); +print(intNum * trueValue); +print(intNum / trueValue); +print(intNum % trueValue); +print(intNum < trueValue); +print(intNum <= trueValue); +print(intNum > trueValue); +print(intNum >= trueValue); +print(intNum == trueValue); +print(intNum === trueValue); +print(intNum != trueValue); +print(intNum !== trueValue); +print(intNum << trueValue); +print(intNum >> trueValue); +print(intNum >>> trueValue); +print(intNum | trueValue); +print(intNum ^ trueValue); // double op true print("=====double op true=====") -assert_equal(doubleNum + trueValue, 2.1); -assert_equal(doubleNum - trueValue, 0.10000000000000009); -assert_equal(doubleNum * trueValue, 1.1); -assert_equal(doubleNum / trueValue, 1.1); -assert_equal(doubleNum % trueValue, 0.10000000000000009); -assert_equal(doubleNum < trueValue, falseValue); -assert_equal(doubleNum <= trueValue, falseValue); -assert_equal(doubleNum > trueValue, trueValue); -assert_equal(doubleNum >= trueValue, trueValue); -assert_equal(doubleNum == trueValue, falseValue); -assert_equal(doubleNum === trueValue, falseValue); -assert_equal(doubleNum != trueValue, trueValue); -assert_equal(doubleNum !== trueValue, trueValue); -assert_equal(doubleNum << trueValue, 2); -assert_equal(doubleNum >> trueValue, 0); -assert_equal(doubleNum >>> trueValue, 0); -assert_equal(doubleNum | trueValue, 1); -assert_equal(doubleNum ^ trueValue, 0); +print(doubleNum + trueValue); +print(doubleNum - trueValue); +print(doubleNum * trueValue); +print(doubleNum / trueValue); +print(doubleNum % trueValue); +print(doubleNum < trueValue); +print(doubleNum <= trueValue); +print(doubleNum > trueValue); +print(doubleNum >= trueValue); +print(doubleNum == trueValue); +print(doubleNum === trueValue); +print(doubleNum != trueValue); +print(doubleNum !== trueValue); +print(doubleNum << trueValue); +print(doubleNum >> trueValue); +print(doubleNum >>> trueValue); +print(doubleNum | trueValue); +print(doubleNum ^ trueValue); // true op false print("=====true op false=====") -assert_equal(trueValue + falseValue, 1); -assert_equal(trueValue - falseValue, 1); -assert_equal(trueValue * falseValue, 0); -assert_equal(trueValue / falseValue, Infinity); -assert_true(isNaN(trueValue % falseValue)); -assert_equal(trueValue < falseValue, falseValue); -assert_equal(trueValue <= falseValue, falseValue); -assert_equal(trueValue > falseValue, trueValue); -assert_equal(trueValue >= falseValue, trueValue); -assert_equal(trueValue == falseValue, falseValue); -assert_equal(trueValue === falseValue, falseValue); -assert_equal(trueValue != falseValue, trueValue); -assert_equal(trueValue !== falseValue, trueValue); -assert_equal(trueValue << falseValue, 1); -assert_equal(trueValue >> falseValue, 1); -assert_equal(trueValue >>> falseValue, 1); -assert_equal(trueValue | falseValue, 1); -assert_equal(trueValue ^ falseValue, 1); +print(trueValue + falseValue); +print(trueValue - falseValue); +print(trueValue * falseValue); +print(trueValue / falseValue); +print(trueValue % falseValue); +print(trueValue < falseValue); +print(trueValue <= falseValue); +print(trueValue > falseValue); +print(trueValue >= falseValue); +print(trueValue == falseValue); +print(trueValue === falseValue); +print(trueValue != falseValue); +print(trueValue !== falseValue); +print(trueValue << falseValue); +print(trueValue >> falseValue); +print(trueValue >>> falseValue); +print(trueValue | falseValue); +print(trueValue ^ falseValue); // undefined op undefined print("=====undefined op undefined=====") -assert_true(isNaN(undf + undf)); -assert_true(isNaN(undf - undf)); -assert_true(isNaN(undf * undf)); -assert_true(isNaN(undf / undf)); -assert_true(isNaN(undf % undf)); -assert_equal(undf < undf, falseValue); -assert_equal(undf <= undf, falseValue); -assert_equal(undf > undf, falseValue); -assert_equal(undf >= undf, falseValue); -assert_equal(undf == undf, trueValue); -assert_equal(undf === undf, trueValue); -assert_equal(undf != undf, falseValue); -assert_equal(undf !== undf, falseValue); -assert_equal(undf << undf, 0); -assert_equal(undf >> undf, 0); -assert_equal(undf >>> undf, 0); -assert_equal(undf | undf, 0); -assert_equal(undf ^ undf, 0); +print(undf + undf); +print(undf - undf); +print(undf * undf); +print(undf / undf); +print(undf % undf); +print(undf < undf); +print(undf <= undf); +print(undf > undf); +print(undf >= undf); +print(undf == undf); +print(undf === undf); +print(undf != undf); +print(undf !== undf); +print(undf << undf); +print(undf >> undf); +print(undf >>> undf); +print(undf | undf); +print(undf ^ undf); // null op null print("=====null op null=====") -assert_equal(nullValue + nullValue, 0); -assert_equal(nullValue - nullValue, 0); -assert_equal(nullValue * nullValue, 0); -assert_true(isNaN(nullValue / nullValue)); -assert_true(isNaN(nullValue % nullValue)); -assert_equal(nullValue < nullValue, falseValue); -assert_equal(nullValue <= nullValue, trueValue); -assert_equal(nullValue > nullValue, falseValue); -assert_equal(nullValue >= nullValue, trueValue); -assert_equal(nullValue == nullValue, trueValue); -assert_equal(nullValue === nullValue, trueValue); -assert_equal(nullValue != nullValue, falseValue); -assert_equal(nullValue !== nullValue, falseValue); -assert_equal(nullValue << nullValue, 0); -assert_equal(nullValue >> nullValue, 0); -assert_equal(nullValue >>> nullValue, 0); -assert_equal(nullValue | nullValue, 0); -assert_equal(nullValue ^ nullValue, 0); +print(nullValue + nullValue); +print(nullValue - nullValue); +print(nullValue * nullValue); +print(nullValue / nullValue); +print(nullValue % nullValue); +print(nullValue < nullValue); +print(nullValue <= nullValue); +print(nullValue > nullValue); +print(nullValue >= nullValue); +print(nullValue == nullValue); +print(nullValue === nullValue); +print(nullValue != nullValue); +print(nullValue !== nullValue); +print(nullValue << nullValue); +print(nullValue >> nullValue); +print(nullValue >>> nullValue); +print(nullValue | nullValue); +print(nullValue ^ nullValue); // true op true print("=====true op true=====") -assert_equal(trueValue + trueValue, 2); -assert_equal(trueValue - trueValue, 0); -assert_equal(trueValue * trueValue, 1); -assert_equal(trueValue / trueValue, 1); -assert_equal(trueValue % trueValue, 0); -assert_equal(trueValue < trueValue, falseValue); -assert_equal(trueValue <= trueValue, trueValue); -assert_equal(trueValue > trueValue, falseValue); -assert_equal(trueValue >= trueValue, trueValue); -assert_equal(trueValue == trueValue, trueValue); -assert_equal(trueValue === trueValue, trueValue); -assert_equal(trueValue != trueValue, falseValue); -assert_equal(trueValue !== trueValue, falseValue); -assert_equal(trueValue << trueValue, 2); -assert_equal(trueValue >> trueValue, 0); -assert_equal(trueValue >>> trueValue, 0); -assert_equal(trueValue | trueValue, 1); -assert_equal(trueValue ^ trueValue, 0); +print(trueValue + trueValue); +print(trueValue - trueValue); +print(trueValue * trueValue); +print(trueValue / trueValue); +print(trueValue % trueValue); +print(trueValue < trueValue); +print(trueValue <= trueValue); +print(trueValue > trueValue); +print(trueValue >= trueValue); +print(trueValue == trueValue); +print(trueValue === trueValue); +print(trueValue != trueValue); +print(trueValue !== trueValue); +print(trueValue << trueValue); +print(trueValue >> trueValue); +print(trueValue >>> trueValue); +print(trueValue | trueValue); +print(trueValue ^ trueValue); // false op false print("=====false op false=====") -assert_equal(falseValue + falseValue, 0); -assert_equal(falseValue - falseValue, 0); -assert_equal(falseValue * falseValue, 0); -assert_true(isNaN(falseValue / falseValue)); -assert_true(isNaN(falseValue % falseValue)); -assert_equal(falseValue < falseValue, falseValue); -assert_equal(falseValue <= falseValue, trueValue); -assert_equal(falseValue > falseValue, falseValue); -assert_equal(falseValue >= falseValue, trueValue); -assert_equal(falseValue == falseValue, trueValue); -assert_equal(falseValue === falseValue, trueValue); -assert_equal(falseValue != falseValue, falseValue); -assert_equal(falseValue !== falseValue, falseValue); -assert_equal(falseValue << falseValue, 0); -assert_equal(falseValue >> falseValue, 0); -assert_equal(falseValue >>> falseValue, 0); -assert_equal(falseValue | falseValue, 0); -assert_equal(falseValue ^ falseValue, 0); \ No newline at end of file +print(falseValue + falseValue); +print(falseValue - falseValue); +print(falseValue * falseValue); +print(falseValue / falseValue); +print(falseValue % falseValue); +print(falseValue < falseValue); +print(falseValue <= falseValue); +print(falseValue > falseValue); +print(falseValue >= falseValue); +print(falseValue == falseValue); +print(falseValue === falseValue); +print(falseValue != falseValue); +print(falseValue !== falseValue); +print(falseValue << falseValue); +print(falseValue >> falseValue); +print(falseValue >>> falseValue); +print(falseValue | falseValue); +print(falseValue ^ falseValue); \ No newline at end of file diff --git a/test/aottest/binaryop_special_value/expect_output.txt b/test/aottest/binaryop_special_value/expect_output.txt new file mode 100644 index 0000000000..80806963d8 --- /dev/null +++ b/test/aottest/binaryop_special_value/expect_output.txt @@ -0,0 +1,374 @@ +# Copyright (c) 2023 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +=====int op undefined===== +NaN +NaN +NaN +NaN +NaN +false +false +false +false +false +false +true +true +5 +5 +5 +5 +5 +=====double op undefined===== +NaN +NaN +NaN +NaN +NaN +false +false +false +false +false +false +true +true +1 +1 +1 +1 +1 +=====false op undefined===== +NaN +NaN +NaN +NaN +NaN +false +false +false +false +false +false +true +true +0 +0 +0 +0 +0 +=====true op undefined===== +NaN +NaN +NaN +NaN +NaN +false +false +false +false +false +false +true +true +1 +1 +1 +1 +1 +=====null op undefined===== +NaN +NaN +NaN +NaN +NaN +false +false +false +false +true +false +false +true +0 +0 +0 +0 +0 +=====int op null===== +5 +5 +0 +Infinity +NaN +false +false +true +true +false +false +true +true +5 +5 +5 +5 +5 +=====double op null===== +1.1 +1.1 +0 +Infinity +NaN +false +false +true +true +false +false +true +true +1 +1 +1 +1 +1 +=====false op null===== +0 +0 +0 +NaN +NaN +false +true +false +true +false +false +true +true +0 +0 +0 +0 +0 +=====true op null===== +1 +1 +0 +Infinity +NaN +false +false +true +true +false +false +true +true +1 +1 +1 +1 +1 +=====int op false===== +5 +5 +0 +Infinity +NaN +false +false +true +true +false +false +true +true +5 +5 +5 +5 +5 +=====double op false===== +1.1 +1.1 +0 +Infinity +NaN +false +false +true +true +false +false +true +true +1 +1 +1 +1 +1 +=====true op false===== +1 +1 +0 +Infinity +NaN +false +false +true +true +false +false +true +true +1 +1 +1 +1 +1 +=====int op true===== +6 +4 +5 +5 +0 +false +false +true +true +false +false +true +true +10 +2 +2 +5 +4 +=====double op true===== +2.1 +0.10000000000000009 +1.1 +1.1 +0.10000000000000009 +false +false +true +true +false +false +true +true +2 +0 +0 +1 +0 +=====true op false===== +1 +1 +0 +Infinity +NaN +false +false +true +true +false +false +true +true +1 +1 +1 +1 +1 +=====undefined op undefined===== +NaN +NaN +NaN +NaN +NaN +false +false +false +false +true +true +false +false +0 +0 +0 +0 +0 +=====null op null===== +0 +0 +0 +NaN +NaN +false +true +false +true +true +true +false +false +0 +0 +0 +0 +0 +=====true op true===== +2 +0 +1 +1 +0 +false +true +false +true +true +true +false +false +2 +0 +0 +1 +0 +=====false op false===== +0 +0 +0 +NaN +NaN +false +true +false +true +true +true +false +false +0 +0 +0 +0 +0 diff --git a/test/aottest/bind/BUILD.gn b/test/aottest/bind/BUILD.gn index 10736e8098..1f52436920 100644 --- a/test/aottest/bind/BUILD.gn +++ b/test/aottest/bind/BUILD.gn @@ -13,6 +13,6 @@ import("//arkcompiler/ets_runtime/test/test_helper.gni") -host_aot_assert_test_action("bind") { +host_aot_test_action("bind") { deps = [] } diff --git a/test/aottest/bind/bind.ts b/test/aottest/bind/bind.ts index 6a0a639c76..3b459fef03 100644 --- a/test/aottest/bind/bind.ts +++ b/test/aottest/bind/bind.ts @@ -13,17 +13,17 @@ * limitations under the License. */ -declare function assert_equal(a: Object, b: Object):void; +declare function print(arg:any):string; function foo(a:any, b:any) { return a + b } -assert_equal(foo(1, 2), 3); +print(foo(1, 2)); var bindfunc = foo.bind(null, 37); -assert_equal(bindfunc(5), 42) +print(bindfunc(5)); const person = { name: 'Alice' @@ -33,15 +33,15 @@ const greetPerson = function aaaaaa(message, message2, message3, message4) { print(message + ', ' + message2 + ', ' + message3 + ', ' + message4 + ', ' + this.name + '!'); }.bind(person, 'hello'); greetPerson(); -assert_equal(greetPerson.name, "bound aaaaaa"); -assert_equal(greetPerson.length, 3); +print(greetPerson.name); +print(greetPerson.length); const greetPerson2 = greetPerson.bind(person, 'hello2'); greetPerson2(); -assert_equal(greetPerson2.name, "bound bound aaaaaa"); -assert_equal(greetPerson2.length, 2); +print(greetPerson2.name); +print(greetPerson2.length); const greetPerson3 = greetPerson2.bind(greetPerson, 'hello3'); greetPerson3(); -assert_equal(greetPerson3.name, "bound bound bound aaaaaa"); -assert_equal(greetPerson3.length, 1); \ No newline at end of file +print(greetPerson3.name); +print(greetPerson3.length); \ No newline at end of file diff --git a/test/aottest/bind/expect_output.txt b/test/aottest/bind/expect_output.txt new file mode 100644 index 0000000000..387c2ce708 --- /dev/null +++ b/test/aottest/bind/expect_output.txt @@ -0,0 +1,24 @@ +# Copyright (c) 2022 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +3 +42 +hello, undefined, undefined, undefined, Alice! +bound aaaaaa +3 +hello, hello2, undefined, undefined, Alice! +bound bound aaaaaa +2 +hello, hello2, hello3, undefined, Alice! +bound bound bound aaaaaa +1 diff --git a/test/aottest/builtinmath/BUILD.gn b/test/aottest/builtinmath/BUILD.gn index 07171228e6..282eac53b4 100644 --- a/test/aottest/builtinmath/BUILD.gn +++ b/test/aottest/builtinmath/BUILD.gn @@ -13,6 +13,6 @@ import("//arkcompiler/ets_runtime/test/test_helper.gni") -host_aot_assert_test_action("builtinmath") { +host_aot_test_action("builtinmath") { deps = [] } diff --git a/test/aottest/builtinmath/builtinmath.ts b/test/aottest/builtinmath/builtinmath.ts index 33ad119458..b3dada8457 100644 --- a/test/aottest/builtinmath/builtinmath.ts +++ b/test/aottest/builtinmath/builtinmath.ts @@ -14,125 +14,123 @@ */ declare function print(arg:any):string; -declare function assert_true(condition: boolean):void; -declare function assert_equal(a: Object, b: Object):void; function replace(a : number) { return a; } let len:number = 1; len = 1 / Math.sqrt(len); -assert_equal(len, 1); +print(len); len = 9 / len; len = Math.sqrt(len); -assert_equal(len, 3); +print(len); print(NaN); len = Math.sqrt(NaN); -assert_true(isNaN(len)); +print(len); len = Math.sqrt(+0); // 0 -assert_equal(len, 0); +print(len); len = Math.sqrt(Number.POSITIVE_INFINITY); // Infinity -assert_equal(len, Infinity); +print(len); len = Math.sqrt(Number.NEGATIVE_INFINITY); // NaN -assert_true(isNaN(len)); +print(len); len = Math.sqrt(-1); // NaN -assert_true(isNaN(len)); +print(len); function sqrt() { Math.sqrt = replace; len = Math.sqrt(9) - assert_equal(len, 9); + print(len); } sqrt() len = Math.cos(0); // 1 -assert_equal(len, 1); +print(len); len = Math.cos(1); // 0.5.... -assert_equal(len, 0.5403023058681398); +print(len); function cos() { Math.cos = replace; len = Math.cos(1); - assert_equal(len, 1); + print(len); } cos() len = Math.sin(0); // 0 -assert_equal(len, 0); +print(len); len = Math.sin(1); // 0.84 -assert_equal(len, 0.8414709848078965); +print(len); len = Math.sin(Math.PI / 2); -assert_equal(len, 1); +print(len); function sin() { Math.sin = replace; len = Math.sin(1) - assert_equal(len, 1); + print(len); } sin() len = Math.acos(0.5);// 1.0471975511965979 -assert_equal(len, 1.0471975511965979); +print(len); function acos() { Math.acos = replace len = Math.acos(0.5) - assert_equal(len, 0.5); + print(len); } acos() len = Math.atan(2); // 1.1071487177940904 -assert_equal(len, 1.1071487177940904); +print(len); function atan() { Math.atan = replace len = Math.atan(2) - assert_equal(len, 2); + print(len); } atan() len = Math.abs(Number.NaN); -assert_true(isNaN(len)); +print(len); len = Math.abs(-Number.NaN); -assert_true(isNaN(len)); +print(len); len = Math.abs(Number.NEGATIVE_INFINITY); -assert_equal(len, Infinity); +print(len); len = Math.abs(Number.POSITIVE_INFINITY); -assert_equal(len, Infinity); +print(len); len = Math.abs(9.6); -assert_equal(len, 9.6); +print(len); len = Math.abs(6); -assert_equal(len, 6); +print(len); len = Math.abs(-9.6); -assert_equal(len, 9.6); +print(len); len = Math.abs(-6); -assert_equal(len, 6); +print(len); function abs() { Math.abs = replace len = Math.abs(-9.6) - assert_equal(len, -9.6); + print(len); } abs() len = Math.floor(Number.NaN); -assert_true(isNaN(len)); +print(len); len = Math.floor(-Number.NaN); -assert_true(isNaN(len)); +print(len); len = Math.floor(Number.NEGATIVE_INFINITY); -assert_equal(len, -Infinity); +print(len); len = Math.floor(Number.POSITIVE_INFINITY); -assert_equal(len, Infinity); +print(len); len = Math.floor(9.6); -assert_equal(len, 9); +print(len); len = Math.floor(-9.6); -assert_equal(len, -10); +print(len); function floor() { Math.floor = replace len = Math.floor(-9.6) - assert_equal(len, -9.6); + print(len); } floor() diff --git a/test/aottest/builtinmath/expect_output.txt b/test/aottest/builtinmath/expect_output.txt new file mode 100644 index 0000000000..00ab29db34 --- /dev/null +++ b/test/aottest/builtinmath/expect_output.txt @@ -0,0 +1,49 @@ +# Copyright (c) 2022 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +1 +3 +NaN +NaN +0 +Infinity +NaN +NaN +9 +1 +0.5403023058681398 +1 +0 +0.8414709848078965 +1 +1 +1.0471975511965979 +0.5 +1.1071487177940904 +2 +NaN +NaN +Infinity +Infinity +9.6 +6 +9.6 +6 +-9.6 +NaN +NaN +-Infinity +Infinity +9 +-10 +-9.6 diff --git a/test/aottest/call_same_bytecode_func/BUILD.gn b/test/aottest/call_same_bytecode_func/BUILD.gn index 2c11cbfa51..58c7f4e48f 100644 --- a/test/aottest/call_same_bytecode_func/BUILD.gn +++ b/test/aottest/call_same_bytecode_func/BUILD.gn @@ -13,6 +13,6 @@ import("//arkcompiler/ets_runtime/test/test_helper.gni") -host_aot_assert_test_action("call_same_bytecode_func") { +host_aot_test_action("call_same_bytecode_func") { deps = [] } diff --git a/test/aottest/call_same_bytecode_func/call_same_bytecode_func.ts b/test/aottest/call_same_bytecode_func/call_same_bytecode_func.ts index 075559b13b..cbcdc609d8 100644 --- a/test/aottest/call_same_bytecode_func/call_same_bytecode_func.ts +++ b/test/aottest/call_same_bytecode_func/call_same_bytecode_func.ts @@ -13,7 +13,6 @@ * limitations under the License. */ declare function print(str:any):string; -declare function assert_equal(a: Object, b: Object):void; function foo1(a:string, b:string) { @@ -34,8 +33,8 @@ function foo4() { print("hello"); } -assert_equal(foo2(3, 4), 7); -assert_equal(foo1("1", "2"), "12"); +print(foo2(3, 4)); +print(foo1("1", "2")); foo3(); foo4(); \ No newline at end of file diff --git a/test/aottest/call_same_bytecode_func/expect_output.txt b/test/aottest/call_same_bytecode_func/expect_output.txt new file mode 100644 index 0000000000..952d41f7e5 --- /dev/null +++ b/test/aottest/call_same_bytecode_func/expect_output.txt @@ -0,0 +1,17 @@ +# Copyright (c) 2022 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +7 +12 +hello +hello diff --git a/test/aottest/callithisrange/BUILD.gn b/test/aottest/callithisrange/BUILD.gn index 518ee6da14..629e3f8d8a 100644 --- a/test/aottest/callithisrange/BUILD.gn +++ b/test/aottest/callithisrange/BUILD.gn @@ -13,6 +13,6 @@ import("//arkcompiler/ets_runtime/test/test_helper.gni") -host_aot_assert_test_action("callithisrange") { +host_aot_test_action("callithisrange") { deps = [] } diff --git a/test/aottest/callithisrange/expect_output.txt b/test/aottest/callithisrange/expect_output.txt new file mode 100644 index 0000000000..980d545b98 --- /dev/null +++ b/test/aottest/callithisrange/expect_output.txt @@ -0,0 +1,14 @@ +# Copyright (c) 2022 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +pass diff --git a/test/aottest/calls/BUILD.gn b/test/aottest/calls/BUILD.gn index cf5388d07a..9938a0386d 100644 --- a/test/aottest/calls/BUILD.gn +++ b/test/aottest/calls/BUILD.gn @@ -13,6 +13,6 @@ import("//arkcompiler/ets_runtime/test/test_helper.gni") -host_aot_assert_test_action("calls") { +host_aot_test_action("calls") { deps = [] } diff --git a/test/aottest/calls/calls.ts b/test/aottest/calls/calls.ts index 086c55d2f2..65becf9430 100644 --- a/test/aottest/calls/calls.ts +++ b/test/aottest/calls/calls.ts @@ -13,7 +13,6 @@ * limitations under the License. */ declare function print(str: any): string; -declare function assert_equal(a: Object, b: Object):void; declare var ArkTools:any; function foo() { return "pass"; @@ -35,91 +34,67 @@ function foo4(a: any, b: any, c: any, d: any) { return a + b + c + d; } -assert_equal(foo(), "pass"); -assert_equal(foo1(1), 2); -assert_equal(foo1(1), 2); -assert_equal(foo1(1), 2); -assert_equal(foo2(1, 2), 3); -assert_equal(foo3(1, 2, 3), 6); -assert_equal(foo4(1, 2, 3, 4), 10); +print(foo()); +print(foo1(1)); +print(foo1(1)); +print(foo1(1)); +print(foo2(1, 2)); +print(foo3(1, 2, 3)); +print(foo4(1, 2, 3, 4)); -var classTestNameA = "unassigned"; -var classTestNumA1 = -1; -var classTestNumA2 = -1; class A { public mode: number = 1; constructor(dt: number) { - classTestNumA1 = dt; - classTestNameA = new.target.name; + print(dt); + print(new.target.name); const size = 50; this.mode = 4; } update (dt: number, dt1: number): void { - classTestNumA1 = dt; - classTestNumA2 = dt1; + print(dt); + print(dt1); } } -var classTestNameB = "unassigned"; -var classTestNumB1 = -1; -var classTestNumB2 = -1; -var classTestNumB3 = -1; class B { public mode: number = 1; constructor(dt: number, dt1: number, dt2: number) { - classTestNumB1 = dt; - classTestNumB2 = dt1; - classTestNumB3 = dt2; - classTestNameB = new.target.name; + print(dt); + print(dt1); + print(dt2); + print(new.target.name); const size = 50; this.mode = 4; } } -var classTestNameC = "unassigned"; -var classTestNumC1 = -1; -var classTestNumC2 = -1; -var classTestNumC3 = -1; -var classTestNumC4 = -1; -var classTestNumC5 = -1; -var classTestNumC6 = -1; -var classTestNumC7 = -1; -var classTestNumC8 = -1; class C { public mode: number = 1; constructor(dt: number, dt1: number, dt2: number, dt3: number, dt4: number, dt5: number, dt6: number, dt7: number) { - classTestNameC = new.target.name; - classTestNumC1 = dt; - classTestNumC2 = dt1; - classTestNumC5 = dt4; - classTestNumC7 = dt6; - classTestNumC8 = dt7; + print(new.target.name); + print(dt); + print(dt1); + print(dt4); + print(dt6); + print(dt7); const size = 50; this.mode = 4; } } -var funcvTestNum1 = -1; -var funcvTestNum2 = -1; -var funcvTestNum3 = -1; -var funcvTestNum4 = -1; -var funcvTestNum5 = -1; -var funcvTestNum6 = -1; -var funcvTestNum7 = -1; -var funcvTestNum8 = -1; function funcv(value: number, value1: number, value2: number, value3: number, value4: number, value5: number, value6: number, value7: number): number { - funcvTestNum1 = value; - funcvTestNum2 = value1; - funcvTestNum3 = value2; - funcvTestNum4 = value3; - funcvTestNum5 = value4; - funcvTestNum6 = value5; - funcvTestNum7 = value6; - funcvTestNum8 = value7; + print(value); + print(value1); + print(value2); + print(value3); + print(value4); + print(value5); + print(value6); + print(value7); return 100; } @@ -127,157 +102,69 @@ function func0(): number { return 110; } -var func1TestNum = -1; function func1(value: number): number { - func1TestNum = value; + print(value); return value; } -var func2TestNum1 = -1; -var func2TestNum2 = -1; function func2(value: number, value1: number): number { - func2TestNum1 = value; - func2TestNum2 = value1; + print(value); + print(value1); return value; } -var func3TestNum1 = -1; -var func3TestNum2 = -1; -var func3TestNum3 = -1; function func3(value: number, value1: number, value2: number): number { - func3TestNum1 = value; - func3TestNum2 = value1; - func3TestNum3 = value2; + print(value); + print(value1); + print(value2); func1(value); return value; } -var func4TestNum1 = -1; -var func4TestNum2 = -1; -var func4TestNum3 = -1; -var func4TestNum4 = -1; function func4(value: number, value1: number, value2: number, value3: number): number { - func4TestNum1 = value; - func4TestNum2 = value1; - func4TestNum3 = value2; - func4TestNum4 = value3; + print(value); + print(value1); + print(value2); + print(value3); return value; } -var classTestName = "unassigned"; function testNewTarget(value: number): number { - classTestName = new.target.name; + print(new.target.name); return value; } var systems: A = new A(1); -assert_equal(classTestNumA1, 1); -assert_equal(classTestNameA, "A"); var systems1: B = new B(2, 3); -assert_equal(classTestNumB1, 2); -assert_equal(classTestNumB2, 3); -assert_equal(classTestNumB3, undefined); -assert_equal(classTestNameB, "B"); var systems2: C = new C(3, 4, 5, 6, 7, 8); -assert_equal(classTestNameC, "C"); -assert_equal(classTestNumC1, 3); -assert_equal(classTestNumC2, 4); -assert_equal(classTestNumC5, 7); -assert_equal(classTestNumC7, undefined); -assert_equal(classTestNumC8, undefined); -assert_equal(func0(), 110); +print(func0()); func1(); -assert_equal(func1TestNum, undefined); func2(1); -assert_equal(func2TestNum1, 1); -assert_equal(func2TestNum2, undefined); func3("mytest", 2); -assert_equal(func3TestNum1, "mytest"); -assert_equal(func3TestNum2, 2); -assert_equal(func3TestNum3, undefined); -assert_equal(func1TestNum, "mytest"); func4(3, 4, 5); -assert_equal(func4TestNum1, 3); -assert_equal(func4TestNum2, 4); -assert_equal(func4TestNum3, 5); -assert_equal(func4TestNum4, undefined); funcv(6, 7 , 8, 9); -assert_equal(funcvTestNum1, 6); -assert_equal(funcvTestNum2, 7); -assert_equal(funcvTestNum3, 8); -assert_equal(funcvTestNum4, 9) -assert_equal(funcvTestNum5, undefined); -assert_equal(funcvTestNum6, undefined); -assert_equal(funcvTestNum7, undefined); -assert_equal(funcvTestNum8, undefined) systems.update(4); -assert_equal(classTestNumA1, 4) -assert_equal(classTestNumA2, undefined); var k = new testNewTarget(1); -assert_equal(classTestName, "testNewTarget"); -var funcAsmTestNum1 = -1; -var funcAsmTestNum2 = -1; -var funcAsmTestNum3 = -1; function funcAsm(value: number, value1: number, value2: number): number { - funcAsmTestNum1 = value; - funcAsmTestNum2 = value1; - funcAsmTestNum3 = value2; + print(value); + print(value1); + print(value2); func2(value1, value2); - assert_equal(func2TestNum1, 2); - assert_equal(func2TestNum2, undefined); func3(value1, value2); - assert_equal(func3TestNum1, 2); - assert_equal(func3TestNum2, undefined); - assert_equal(func3TestNum3, undefined); - assert_equal(func1TestNum, 2); func4(value1); - assert_equal(func4TestNum1, 2); - assert_equal(func4TestNum2, undefined); - assert_equal(func4TestNum3, undefined); - assert_equal(func4TestNum4, undefined); funcv(value, value1, value2, value); - assert_equal(funcvTestNum1, 1); - assert_equal(funcvTestNum2, 2); - assert_equal(funcvTestNum3, undefined); - assert_equal(funcvTestNum4, 1); - assert_equal(funcvTestNum5, undefined); - assert_equal(funcvTestNum6, undefined); - assert_equal(funcvTestNum7, undefined); - assert_equal(funcvTestNum8, undefined); var s: A = new A(1, 4); - assert_equal(classTestNumA1, 1); - assert_equal(classTestNameA, "A"); var s1: B = new B(2, 3); - assert_equal(classTestNumB1, 2); - assert_equal(classTestNumB2, 3); - assert_equal(classTestNumB3, undefined); - assert_equal(classTestNameB, "B"); var s2: C = new C(3, 4, 5, 6, 7, 8); - assert_equal(classTestNameC, "C"); - assert_equal(classTestNumC1, 3); - assert_equal(classTestNumC2, 4); - assert_equal(classTestNumC5, 7); - assert_equal(classTestNumC7, undefined); - assert_equal(classTestNumC8, undefined); var s3: C = new C(3, 4, 5, 6, 7, 8, 9, 10); - assert_equal(classTestNameC, "C"); - assert_equal(classTestNumC1, 3); - assert_equal(classTestNumC2, 4); - assert_equal(classTestNumC5, 7); - assert_equal(classTestNumC7, 9); - assert_equal(classTestNumC8, 10); return value; } ArkTools.removeAOTFlag(funcAsm); funcAsm(1, 2); -assert_equal(funcAsmTestNum1, 1); -assert_equal(funcAsmTestNum2, 2); -assert_equal(funcAsmTestNum3, undefined); -var TestCallArg = "unassigned"; class TestCallThis0 { foo(arg?: any) { - TestCallArg = arg; + print(arg); } } @@ -287,4 +174,3 @@ function testCallThis0() { } testCallThis0(); -assert_equal(TestCallArg, undefined); diff --git a/test/aottest/calls/expect_output.txt b/test/aottest/calls/expect_output.txt new file mode 100644 index 0000000000..400c7e9bf5 --- /dev/null +++ b/test/aottest/calls/expect_output.txt @@ -0,0 +1,95 @@ +# Copyright (c) 2022 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +pass +2 +2 +2 +3 +6 +10 +1 +A +2 +3 +undefined +B +C +3 +4 +7 +undefined +undefined +110 +undefined +1 +undefined +mytest +2 +undefined +mytest +3 +4 +5 +undefined +6 +7 +8 +9 +undefined +undefined +undefined +undefined +4 +undefined +testNewTarget +1 +2 +undefined +2 +undefined +2 +undefined +undefined +2 +2 +undefined +undefined +undefined +1 +2 +undefined +1 +undefined +undefined +undefined +undefined +1 +A +2 +3 +undefined +B +C +3 +4 +7 +undefined +undefined +C +3 +4 +7 +9 +10 +undefined diff --git a/test/aottest/class_method_signature/BUILD.gn b/test/aottest/class_method_signature/BUILD.gn index 36a1c601ad..a68e4c15cd 100644 --- a/test/aottest/class_method_signature/BUILD.gn +++ b/test/aottest/class_method_signature/BUILD.gn @@ -13,6 +13,6 @@ import("//arkcompiler/ets_runtime/test/test_helper.gni") -host_aot_assert_test_action("class_method_signature") { +host_aot_test_action("class_method_signature") { deps = [] } diff --git a/test/aottest/class_method_signature/class_method_signature.ts b/test/aottest/class_method_signature/class_method_signature.ts index 2236f909df..5fc1498268 100644 --- a/test/aottest/class_method_signature/class_method_signature.ts +++ b/test/aottest/class_method_signature/class_method_signature.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -declare function assert_equal(a: Object, b: Object):void; +declare function print(str:any):string; class A { constructor() {} @@ -30,9 +30,9 @@ class A { } let a = new A(); -assert_equal(a.bar(), "bar"); -assert_equal(a.bar2(), "bar2"); -assert_equal(Reflect.ownKeys(A.prototype), ["constructor", "bar", "bar2"]); //constructor,bar,bar2 +print(a.bar()); +print(a.bar2()); +print(Reflect.ownKeys(A.prototype)); //constructor,bar,bar2 class A2 { constructor() {} @@ -52,10 +52,10 @@ class A2 { } let a2 = new A2(); -assert_equal(a2.foo(), "foo"); -assert_equal(a2.bar(), "bar"); -assert_equal(a2.bar2(), "bar2"); -assert_equal(Reflect.ownKeys(A2.prototype), ["constructor", "foo", "bar", "bar2"]); //constructor,foo,bar,bar2 +print(a2.foo()); +print(a2.bar()); +print(a2.bar2()); +print(Reflect.ownKeys(A2.prototype)); //constructor,foo,bar,bar2 class B { @@ -73,9 +73,9 @@ class B { } let b = new B(); -assert_equal(b.bar(), "bar"); -assert_equal(b.bar2(), "bar2"); -assert_equal(Reflect.ownKeys(B.prototype), ["constructor", "bar", "bar2"]); //constructor,bar,bar2 +print(b.bar()); +print(b.bar2()); +print(Reflect.ownKeys(B.prototype)); //constructor,bar,bar2 class B2 { constructor() {} @@ -95,10 +95,10 @@ class B2 { } let b2 = new B2(); -assert_equal(b2.foo(), "foo"); -assert_equal(b2.bar(), "bar"); -assert_equal(b2.bar2(), "bar2"); -assert_equal(Reflect.ownKeys(B2.prototype), ["constructor", "bar", "foo", "bar2"]); //constructor,bar,foo,bar2 +print(b2.foo()); +print(b2.bar()); +print(b2.bar2()); +print(Reflect.ownKeys(B2.prototype)); //constructor,bar,foo,bar2 // one signature but no body class C { @@ -112,7 +112,7 @@ class C { } let c = new C(); -assert_equal(c.bar(), "test one signature but no body"); +print(c.bar()); // multi-signatures but one body class D { @@ -132,8 +132,8 @@ class D { } let d = new D(); -assert_equal(d.foo!("D"), "D"); -assert_equal(d.bar(), "test multi-signatures but one body"); +print(d.foo!("D")); +print(d.bar()); // multi-signature but no body. class E { @@ -155,6 +155,6 @@ E.prototype.foo = function(): string { } let e = new E(); -assert_equal(e.foo!(), "E"); -assert_equal(e.bar(), "test multi-signatures but no body"); +print(e.foo!()); +print(e.bar()); diff --git a/test/aottest/class_method_signature/expect_output.txt b/test/aottest/class_method_signature/expect_output.txt new file mode 100644 index 0000000000..e846618f11 --- /dev/null +++ b/test/aottest/class_method_signature/expect_output.txt @@ -0,0 +1,32 @@ +# Copyright (c) 2023 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +bar +bar2 +constructor,bar,bar2 +foo +bar +bar2 +constructor,foo,bar,bar2 +bar +bar2 +constructor,bar,bar2 +foo +bar +bar2 +constructor,bar,foo,bar2 +test one signature but no body +D +test multi-signatures but one body +E +test multi-signatures but no body diff --git a/test/aottest/classstatic/BUILD.gn b/test/aottest/classstatic/BUILD.gn index 4f9ad655ce..0b10d1a8d7 100644 --- a/test/aottest/classstatic/BUILD.gn +++ b/test/aottest/classstatic/BUILD.gn @@ -13,6 +13,6 @@ import("//arkcompiler/ets_runtime/test/test_helper.gni") -host_aot_assert_test_action("classstatic") { +host_aot_test_action("classstatic") { deps = [] } diff --git a/test/aottest/classstatic/classstatic.ts b/test/aottest/classstatic/classstatic.ts index 7c28eaea37..a532976905 100644 --- a/test/aottest/classstatic/classstatic.ts +++ b/test/aottest/classstatic/classstatic.ts @@ -13,28 +13,24 @@ * limitations under the License. */ declare function print(arg:any, arg1?:any):string; -declare function assert_unreachable():void; -declare function assert_equal(a: Object, b: Object):void; -var cpuTestNum1 = -1; -var cpuTestNum2 = -1; class cpu { public mode: number = 1; constructor() { this.mode = 4; } public static add(a: number, b: number): number { - cpuTestNum1 = a; + print(a); cpu.sub(a, b); var out : number = a + b; return out; } get kind() { - assert_equal(this.mode, 4); + print(this.mode); return this.mode; } public static sub(a: number, b: number): number { - cpuTestNum2 = b; + print(b); var out : number = a + b; return out; } @@ -189,7 +185,7 @@ class cpu1 { } get kind() { - return this.mode; + print(this.mode); } static Constant = 1; static Curve = 2; @@ -199,23 +195,19 @@ class cpu1 { function foo():number { return cpu.Curve; } -assert_equal(foo(), 2); +print(foo()); cpu.add(1, 3); -assert_equal(cpuTestNum1, 1); -assert_equal(cpuTestNum2, 3); var systems: cpu = new cpu(); -assert_equal(systems.kind, 4); +print(systems.kind); cpu.sub(1, 4); -assert_equal(cpuTestNum2, 4); -assert_equal(cpu1.TwoC, 3); -assert_equal(cpu1.length, 0); +print(cpu1.TwoC); +print(cpu1.length); cpu1.color(); try { cpu1.length = 4; - assert_unreachable(); } catch (e) { - assert_equal(e.message, "Cannot assign to read only property") + print(e) } class Info { @@ -238,7 +230,7 @@ class Shape { } func1(a:any,...A:any) : void { for (let p in A) { - assert_equal(A[p], 2); + print(A[p]); } } } @@ -313,11 +305,11 @@ class Node{ while (el) { var map = el.map; if (map == names) { - assert_equal(map, "hh") + print(map) } el = el.nodeType == 1 ? el.childNode : el.parentNode; const tmp = Node.Constant; - assert_equal(el, null); + print(el); } } diff --git a/test/aottest/classstatic/expect_output.txt b/test/aottest/classstatic/expect_output.txt new file mode 100644 index 0000000000..6466099f13 --- /dev/null +++ b/test/aottest/classstatic/expect_output.txt @@ -0,0 +1,30 @@ +# Copyright (c) 2022 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +2 +1 +3 +4 +4 +4 +3 +0 +method is ok +TypeError: Cannot assign to read only property +intersect +func1 +intersect +func1 +2 +hh +null diff --git a/test/aottest/closeiterator/BUILD.gn b/test/aottest/closeiterator/BUILD.gn index 740436429d..63ed0fc32d 100644 --- a/test/aottest/closeiterator/BUILD.gn +++ b/test/aottest/closeiterator/BUILD.gn @@ -13,6 +13,6 @@ import("//arkcompiler/ets_runtime/test/test_helper.gni") -host_aot_assert_test_action("closeiterator") { +host_aot_test_action("closeiterator") { deps = [] } diff --git a/test/aottest/closeiterator/expect_output.txt b/test/aottest/closeiterator/expect_output.txt new file mode 100644 index 0000000000..980d545b98 --- /dev/null +++ b/test/aottest/closeiterator/expect_output.txt @@ -0,0 +1,14 @@ +# Copyright (c) 2022 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +pass diff --git a/test/aottest/compiler_test/BUILD.gn b/test/aottest/compiler_test/BUILD.gn index b863136d56..8a44ee35f7 100644 --- a/test/aottest/compiler_test/BUILD.gn +++ b/test/aottest/compiler_test/BUILD.gn @@ -13,6 +13,6 @@ import("//arkcompiler/ets_runtime/test/test_helper.gni") -host_aot_assert_test_action("compiler_test") { +host_aot_test_action("compiler_test") { deps = [] } diff --git a/test/aottest/compiler_test/compiler_test.ts b/test/aottest/compiler_test/compiler_test.ts index c0a76f207d..5fa82e4569 100644 --- a/test/aottest/compiler_test/compiler_test.ts +++ b/test/aottest/compiler_test/compiler_test.ts @@ -13,8 +13,6 @@ * limitations under the License. */ declare function print(str:any):string; -declare function assert_unreachable():void; -declare function assert_equal(a: Object, b: Object):void; // case1: CREATEOBJECTWITHEXCLUDEDKEYS const o4 : {} = { @@ -39,7 +37,6 @@ function f1() { return try { f() - assert_unreachable(); } catch(e) { } } @@ -48,7 +45,6 @@ function f1() { function f2() { try { return - assert_unreachable(); } catch(e15) { } while(1) {} @@ -63,7 +59,7 @@ const v75 : number = new C60() function f230():string { const v292:number = -2; const v303:number[] = [1000,-1970969808,536870887,257,17933,11,1024]; - try { new v292(64, ...v303, ...v303, ...v303, ...v303); assert_unreachable(); } catch (e) {} + try { new v292(64, ...v303, ...v303, ...v303, ...v303); } catch (e) {} return "bigint"; } for (let v316:number = 0; v316 < 5; v316++) { @@ -77,7 +73,6 @@ try { [a1718]; static [v1705] = a1719; } - assert_unreachable(); } catch (e) {} // case8: stackmapNum % 2 @@ -87,9 +82,9 @@ v39++; // case9: this branch is unreachable let v:number = []; -assert_equal(Math.abs(--v), 1); -assert_equal(v, -1); +print(Math.abs(--v)); +print(v); let u:number[] = []; -assert_equal(--u, -1); +print(--u); print("compiler success"); \ No newline at end of file diff --git a/test/aottest/compiler_test/expect_output.txt b/test/aottest/compiler_test/expect_output.txt new file mode 100644 index 0000000000..ebe4534d86 --- /dev/null +++ b/test/aottest/compiler_test/expect_output.txt @@ -0,0 +1,17 @@ +# Copyright (c) 2023 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +1 +-1 +-1 +compiler success diff --git a/test/aottest/constpool/BUILD.gn b/test/aottest/constpool/BUILD.gn index 86f18959b8..ca8cca7387 100644 --- a/test/aottest/constpool/BUILD.gn +++ b/test/aottest/constpool/BUILD.gn @@ -13,6 +13,6 @@ import("//arkcompiler/ets_runtime/test/test_helper.gni") -host_aot_assert_test_action("constpool") { +host_aot_test_action("constpool") { deps = [] } diff --git a/test/aottest/constpool/constpool.ts b/test/aottest/constpool/constpool.ts index 93101481fb..45df4edfd5 100644 --- a/test/aottest/constpool/constpool.ts +++ b/test/aottest/constpool/constpool.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -declare function assert_equal(a: Object, b: Object):void; +declare function print(str:any):string; class A { constructor() {} @@ -23,5 +23,5 @@ class A { z() {} } let a = new A() -assert_equal(a.y, 1) -assert_equal(a.z.name, "z") \ No newline at end of file +print(a.y) +print(a.z.name) \ No newline at end of file diff --git a/test/aottest/constpool/expect_output.txt b/test/aottest/constpool/expect_output.txt new file mode 100644 index 0000000000..d5d105c973 --- /dev/null +++ b/test/aottest/constpool/expect_output.txt @@ -0,0 +1,15 @@ +# Copyright (c) 2023 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +1 +z diff --git a/test/aottest/continue_from_finally/BUILD.gn b/test/aottest/continue_from_finally/BUILD.gn index e46425f8e6..ac377703ff 100644 --- a/test/aottest/continue_from_finally/BUILD.gn +++ b/test/aottest/continue_from_finally/BUILD.gn @@ -13,6 +13,6 @@ import("//arkcompiler/ets_runtime/test/test_helper.gni") -host_aot_assert_test_action("continue_from_finally") { +host_aot_test_action("continue_from_finally") { deps = [] } diff --git a/test/aottest/continue_from_finally/continue_from_finally.ts b/test/aottest/continue_from_finally/continue_from_finally.ts index b11927462b..c879874909 100644 --- a/test/aottest/continue_from_finally/continue_from_finally.ts +++ b/test/aottest/continue_from_finally/continue_from_finally.ts @@ -14,8 +14,6 @@ */ declare function print(arg:any):string; -declare function assert_unreachable():void; -declare function assert_equal(a: Object, b: Object):void; function* values() { yield 1; @@ -27,7 +25,6 @@ function* values() { for (var x of iterator) { try { throw new Error(); - assert_unreachable(); } catch (err) { } finally { i++; @@ -39,4 +36,4 @@ function* values() { print('This code is unreachable (following `try` statement).'); } - assert_equal(i, 2); \ No newline at end of file + print(i); \ No newline at end of file diff --git a/test/aottest/continue_from_finally/expect_output.txt b/test/aottest/continue_from_finally/expect_output.txt new file mode 100644 index 0000000000..fbdf0fc9e2 --- /dev/null +++ b/test/aottest/continue_from_finally/expect_output.txt @@ -0,0 +1,14 @@ +# Copyright (c) 2022 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +2 diff --git a/test/aottest/copyrestargs/BUILD.gn b/test/aottest/copyrestargs/BUILD.gn index af6a6e28ae..7209200698 100644 --- a/test/aottest/copyrestargs/BUILD.gn +++ b/test/aottest/copyrestargs/BUILD.gn @@ -13,6 +13,6 @@ import("//arkcompiler/ets_runtime/test/test_helper.gni") -host_aot_assert_test_action("copyrestargs") { +host_aot_test_action("copyrestargs") { deps = [] } diff --git a/test/aottest/copyrestargs/copyrestargs.ts b/test/aottest/copyrestargs/copyrestargs.ts index d1c065690f..ca0f054780 100644 --- a/test/aottest/copyrestargs/copyrestargs.ts +++ b/test/aottest/copyrestargs/copyrestargs.ts @@ -13,21 +13,21 @@ * limitations under the License. */ -declare function assert_equal(a: Object, b: Object):void; -var testArrary = [2, 3, "success", "fail"]; +declare function print(str:any):string; function f(a:any,...A:any) { for (let p in A) { - A[p] = testArrary[p]; + print(A[p]); } } -f(1, [2, 3, "success", "fail"]); +f(1, 2, 3); +f(1, "success", "fail"); // The following test cases have exposed a bug: the variable actualRestNum in RuntimeOptCopyRestArgs // computed mistakely and may out of uint32_t range. function foo(x: number, y?: number, ...restArgs: number[]):void { let arr = [...restArgs]; - assert_equal(arr.length, 0); + print(arr.length); } foo(1); diff --git a/test/aottest/copyrestargs/expect_output.txt b/test/aottest/copyrestargs/expect_output.txt new file mode 100644 index 0000000000..b15557137a --- /dev/null +++ b/test/aottest/copyrestargs/expect_output.txt @@ -0,0 +1,18 @@ +# Copyright (c) 2022 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +2 +3 +success +fail +0 diff --git a/test/aottest/createarray_meta_data/BUILD.gn b/test/aottest/createarray_meta_data/BUILD.gn index 112d74c3aa..9a99243759 100644 --- a/test/aottest/createarray_meta_data/BUILD.gn +++ b/test/aottest/createarray_meta_data/BUILD.gn @@ -13,7 +13,7 @@ import("//arkcompiler/ets_runtime/test/test_helper.gni") -host_aot_assert_test_action("createarray_meta_data") { +host_aot_test_action("createarray_meta_data") { deps = [] is_only_typed_path = true is_enable_pgo = true diff --git a/test/aottest/createarray_meta_data/createarray_meta_data.ts b/test/aottest/createarray_meta_data/createarray_meta_data.ts index c605f2639f..e9a1ac74e6 100644 --- a/test/aottest/createarray_meta_data/createarray_meta_data.ts +++ b/test/aottest/createarray_meta_data/createarray_meta_data.ts @@ -13,8 +13,7 @@ * limitations under the License. */ -declare function assert_equal(a: Object, b: Object):void; let k =1; let arr:number[] = [-1,-1]; let a2:number[] = [k]; -assert_equal(a2.length, 1); \ No newline at end of file +print(a2.length); \ No newline at end of file diff --git a/test/aottest/createarray_meta_data/expect_output.txt b/test/aottest/createarray_meta_data/expect_output.txt new file mode 100644 index 0000000000..81981cf499 --- /dev/null +++ b/test/aottest/createarray_meta_data/expect_output.txt @@ -0,0 +1,14 @@ +# Copyright (c) 2024 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +1 diff --git a/test/aottest/createarray_meta_data/pgo_expect_output.txt b/test/aottest/createarray_meta_data/pgo_expect_output.txt new file mode 100644 index 0000000000..81981cf499 --- /dev/null +++ b/test/aottest/createarray_meta_data/pgo_expect_output.txt @@ -0,0 +1,14 @@ +# Copyright (c) 2024 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +1 diff --git a/test/aottest/createarrayimm16/BUILD.gn b/test/aottest/createarrayimm16/BUILD.gn index f3439ac018..0e092e145a 100644 --- a/test/aottest/createarrayimm16/BUILD.gn +++ b/test/aottest/createarrayimm16/BUILD.gn @@ -13,6 +13,6 @@ import("//arkcompiler/ets_runtime/test/test_helper.gni") -host_aot_assert_test_action("createarrayimm16") { +host_aot_test_action("createarrayimm16") { deps = [] } diff --git a/test/aottest/createarrayimm16/createarrayimm16.ts b/test/aottest/createarrayimm16/createarrayimm16.ts index d7205bbaba..b6ea92cb93 100644 --- a/test/aottest/createarrayimm16/createarrayimm16.ts +++ b/test/aottest/createarrayimm16/createarrayimm16.ts @@ -154,21 +154,21 @@ function foo() { a134.push(-4); a134[4] = 5; - assert_equal(a134[0], -1); - assert_equal(a134[1], 1.2); - assert_equal(a134[2], 3); - assert_equal(a134[3], -4); - assert_equal(a134[4], 5); + print(a134[0]); + print(a134[1]); + print(a134[2]); + print(a134[3]); + print(a134[4]); a134[4] = a134[2] + a134[1]; - assert_equal(a134[4], 4.2); + print(a134[4]); a133.push(3.2); a133.push(4.8); a133[3] = a133[0] + a133[1]; - assert_equal(a133[0], 3.2); - assert_equal(a133[1], 4.8); - assert_equal(a133[2], undefined); - assert_equal(a133[3], 8); + print(a133[0]); + print(a133[1]); + print(a133[2]); + print(a133[3]); } for (let i = 0; i < 4; i++) { diff --git a/test/aottest/createarrayimm16/expect_output.txt b/test/aottest/createarrayimm16/expect_output.txt new file mode 100644 index 0000000000..df5ec225d5 --- /dev/null +++ b/test/aottest/createarrayimm16/expect_output.txt @@ -0,0 +1,53 @@ +# Copyright (c) 2023 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +-1 +1.2 +3 +-4 +5 +4.2 +3.2 +4.8 +undefined +8 +-1 +1.2 +3 +-4 +5 +4.2 +3.2 +4.8 +undefined +8 +-1 +1.2 +3 +-4 +5 +4.2 +3.2 +4.8 +undefined +8 +-1 +1.2 +3 +-4 +5 +4.2 +3.2 +4.8 +undefined +8 diff --git a/test/aottest/createarraywithbuffer/BUILD.gn b/test/aottest/createarraywithbuffer/BUILD.gn index 4e3b131a7c..20859e3cac 100644 --- a/test/aottest/createarraywithbuffer/BUILD.gn +++ b/test/aottest/createarraywithbuffer/BUILD.gn @@ -13,6 +13,6 @@ import("//arkcompiler/ets_runtime/test/test_helper.gni") -host_aot_assert_test_action("createarraywithbuffer") { +host_aot_test_action("createarraywithbuffer") { deps = [] } diff --git a/test/aottest/createarraywithbuffer/createarraywithbuffer.ts b/test/aottest/createarraywithbuffer/createarraywithbuffer.ts index 600270772a..fbe1c2e65b 100644 --- a/test/aottest/createarraywithbuffer/createarraywithbuffer.ts +++ b/test/aottest/createarraywithbuffer/createarraywithbuffer.ts @@ -13,14 +13,12 @@ * limitations under the License. */ -declare function assert_equal(a: Object, b: Object):void; +declare function print(str:any):string; var arrayIterator = ['fifth', 'sixth', 666]; -assert_equal(arrayIterator[0], "fifth"); -assert_equal(arrayIterator[1], "sixth"); -assert_equal(arrayIterator[2], 666); +print(arrayIterator[0]); +print(arrayIterator[1]); +print(arrayIterator[2]); -var testNum1 = -1; -var testNum2 = -1; class Index { currentArrays: number[][] = [ [0, 0, 0, 0], @@ -57,8 +55,8 @@ class Index { run() { let newArray = this.changeCurretArrays(); - testNum1 = this.computeScore(newArray); - testNum2 = this.computeScore(this.currentArrays); + print(this.computeScore(newArray)); + print(this.computeScore(this.currentArrays)); this.currentArrays = newArray; } } @@ -66,51 +64,49 @@ class Index { let index = new Index; for (let i = 0; i < 3; i++) { index.run(); - assert_equal(testNum1, 16 * (i + 1)); - assert_equal(testNum2, 16 * i); } let K:number[] = []; K.push(8.2); -assert_equal(K[0], 8.2); +print(K[0]); K[1] = 3; -assert_equal(K[1], 3); +print(K[1]); let x = 1.2; let y = 9; let T:number[] = [0, 1, 1.2, x]; -assert_equal(T[0], 0); -assert_equal(T[1], 1); -assert_equal(T[2], 1.2); -assert_equal(T[3], x); +print(T[0]); +print(T[1]); +print(T[2]); +print(T[3]); x = 1; let Ta:number[] = [,, 4.2, x]; let Tb:number[] = [1, y, 1.2, x]; let Tc:number[] = [-2, -9, 8.3, x]; -assert_equal(Ta[0], undefined); -assert_equal(Ta[1], undefined); -assert_equal(Ta[2], 4.2); -assert_equal(Ta[3], 1); +print(Ta[0]); +print(Ta[1]); +print(Ta[2]); +print(Ta[3]); -assert_equal(Tb[0], 1); -assert_equal(Tb[1], 9); -assert_equal(Tb[2], 1.2); -assert_equal(Tb[3], 1); +print(Tb[0]); +print(Tb[1]); +print(Tb[2]); +print(Tb[3]); -assert_equal(Tc[0], -2); -assert_equal(Tc[1], -9); -assert_equal(Tc[2], 8.3); -assert_equal(Tc[3], 1); +print(Tc[0]); +print(Tc[1]); +print(Tc[2]); +print(Tc[3]); let z = {test: 1.8} let Td:number[] = [8848, "aotTest", z, x]; -assert_equal(Td[0], 8848); -assert_equal(Td[1], "aotTest"); -assert_equal(Td[2].test, 1.8); -assert_equal(Td[3], 1); +print(Td[0]); +print(Td[1]); +print(Td[2].test); +print(Td[3]); Td[4] = 9999; -assert_equal(Td[4], 9999); \ No newline at end of file +print(Td[4]); \ No newline at end of file diff --git a/test/aottest/createarraywithbuffer/expect_output.txt b/test/aottest/createarraywithbuffer/expect_output.txt new file mode 100644 index 0000000000..0c26a2855e --- /dev/null +++ b/test/aottest/createarraywithbuffer/expect_output.txt @@ -0,0 +1,45 @@ +# Copyright (c) 2022 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +fifth +sixth +666 +16 +0 +32 +16 +48 +32 +8.2 +3 +0 +1 +1.2 +1.2 +undefined +undefined +4.2 +1 +1 +9 +1.2 +1 +-2 +-9 +8.3 +1 +8848 +aotTest +1.8 +1 +9999 diff --git a/test/aottest/createemptyarray/BUILD.gn b/test/aottest/createemptyarray/BUILD.gn index c128bcaf69..0fce57e644 100644 --- a/test/aottest/createemptyarray/BUILD.gn +++ b/test/aottest/createemptyarray/BUILD.gn @@ -13,6 +13,6 @@ import("//arkcompiler/ets_runtime/test/test_helper.gni") -host_aot_assert_test_action("createemptyarray") { +host_aot_test_action("createemptyarray") { deps = [] } diff --git a/test/aottest/createemptyarray/createemptyarray.ts b/test/aottest/createemptyarray/createemptyarray.ts index 3448d74608..e711f81509 100644 --- a/test/aottest/createemptyarray/createemptyarray.ts +++ b/test/aottest/createemptyarray/createemptyarray.ts @@ -13,9 +13,8 @@ * limitations under the License. */ -declare function assert_true(condition: boolean):void; -declare function assert_equal(a: Object, b: Object):void; +declare function print(str:any):string; var empArr : Array = []; var isArr = Array.isArray(empArr); -assert_equal(empArr.length, 0); -assert_true(isArr); \ No newline at end of file +print(empArr.length); +print(isArr); \ No newline at end of file diff --git a/test/aottest/createemptyarray/expect_output.txt b/test/aottest/createemptyarray/expect_output.txt new file mode 100644 index 0000000000..9cba95e97b --- /dev/null +++ b/test/aottest/createemptyarray/expect_output.txt @@ -0,0 +1,15 @@ +# Copyright (c) 2022 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +0 +true diff --git a/test/aottest/createemptyobject/BUILD.gn b/test/aottest/createemptyobject/BUILD.gn index ec2cfc3152..faf428a3a7 100644 --- a/test/aottest/createemptyobject/BUILD.gn +++ b/test/aottest/createemptyobject/BUILD.gn @@ -13,6 +13,6 @@ import("//arkcompiler/ets_runtime/test/test_helper.gni") -host_aot_assert_test_action("createemptyobject") { +host_aot_test_action("createemptyobject") { deps = [] } diff --git a/test/aottest/createemptyobject/createemptyobject.ts b/test/aottest/createemptyobject/createemptyobject.ts index 4a05077c0d..1ea5f4217d 100644 --- a/test/aottest/createemptyobject/createemptyobject.ts +++ b/test/aottest/createemptyobject/createemptyobject.ts @@ -13,10 +13,9 @@ * limitations under the License. */ -declare function assert_true(condition: boolean):void; -declare function assert_equal(a: Object, b: Object):void; +declare function print(str:any):string; var empObj : {[key:string]:any} = {}; var isObj = typeof empObj == "object"; var keyNums = Object.keys(empObj).length; -assert_equal(keyNums, 0); -assert_true(isObj); \ No newline at end of file +print(keyNums); +print(isObj); \ No newline at end of file diff --git a/test/aottest/createemptyobject/expect_output.txt b/test/aottest/createemptyobject/expect_output.txt new file mode 100644 index 0000000000..9cba95e97b --- /dev/null +++ b/test/aottest/createemptyobject/expect_output.txt @@ -0,0 +1,15 @@ +# Copyright (c) 2022 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +0 +true diff --git a/test/aottest/creategeneratorobj/BUILD.gn b/test/aottest/creategeneratorobj/BUILD.gn index 8894ca4911..e2586f2f76 100644 --- a/test/aottest/creategeneratorobj/BUILD.gn +++ b/test/aottest/creategeneratorobj/BUILD.gn @@ -13,6 +13,6 @@ import("//arkcompiler/ets_runtime/test/test_helper.gni") -host_aot_assert_test_action("creategeneratorobj") { +host_aot_test_action("creategeneratorobj") { deps = [] } diff --git a/test/aottest/creategeneratorobj/expect_output.txt b/test/aottest/creategeneratorobj/expect_output.txt new file mode 100644 index 0000000000..cddf2cc1a7 --- /dev/null +++ b/test/aottest/creategeneratorobj/expect_output.txt @@ -0,0 +1,14 @@ +# Copyright (c) 2022 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +helloworld diff --git a/test/aottest/createiterresultobj/BUILD.gn b/test/aottest/createiterresultobj/BUILD.gn index 226b468740..7ec343ec6e 100644 --- a/test/aottest/createiterresultobj/BUILD.gn +++ b/test/aottest/createiterresultobj/BUILD.gn @@ -13,6 +13,6 @@ import("//arkcompiler/ets_runtime/test/test_helper.gni") -host_aot_assert_test_action("createiterresultobj") { +host_aot_test_action("createiterresultobj") { deps = [] } diff --git a/test/aottest/createiterresultobj/createiterresultobj.ts b/test/aottest/createiterresultobj/createiterresultobj.ts index 92a8df34b5..1ee3a7d4f8 100644 --- a/test/aottest/createiterresultobj/createiterresultobj.ts +++ b/test/aottest/createiterresultobj/createiterresultobj.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -declare function assert_equal(a: Object, b: Object):void; +declare function print(str:any):string; function* foo(){ let index = 0; while(index < 2) { @@ -23,6 +23,6 @@ function* foo(){ let gen = foo(); -assert_equal(gen.next().value, 0); -assert_equal(gen.next().value, 1); -assert_equal(gen.next().value, undefined); \ No newline at end of file +print(gen.next().value); +print(gen.next().value); +print(gen.next().value); \ No newline at end of file diff --git a/test/aottest/createiterresultobj/expect_output.txt b/test/aottest/createiterresultobj/expect_output.txt new file mode 100644 index 0000000000..e1f9d314f5 --- /dev/null +++ b/test/aottest/createiterresultobj/expect_output.txt @@ -0,0 +1,16 @@ +# Copyright (c) 2022 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +0 +1 +undefined diff --git a/test/aottest/createobjecthavingmethod/BUILD.gn b/test/aottest/createobjecthavingmethod/BUILD.gn index 4950bf2cf5..b0c1e092b6 100644 --- a/test/aottest/createobjecthavingmethod/BUILD.gn +++ b/test/aottest/createobjecthavingmethod/BUILD.gn @@ -13,6 +13,6 @@ import("//arkcompiler/ets_runtime/test/test_helper.gni") -host_aot_assert_test_action("createobjecthavingmethod") { +host_aot_test_action("createobjecthavingmethod") { deps = [] } diff --git a/test/aottest/createobjecthavingmethod/createobjecthavingmethod.ts b/test/aottest/createobjecthavingmethod/createobjecthavingmethod.ts index f1c3bb797c..bce0ab6ae9 100644 --- a/test/aottest/createobjecthavingmethod/createobjecthavingmethod.ts +++ b/test/aottest/createobjecthavingmethod/createobjecthavingmethod.ts @@ -13,10 +13,10 @@ * limitations under the License. */ -declare function assert_equal(a: Object, b: Object):void; +declare function print(arg:any):string; var obj = { value: 1, - fun (a:number) {assert_equal(this.value + a, 2)}, + fun (a:number) {print(this.value + a)}, }; obj.fun(1); diff --git a/test/aottest/createobjecthavingmethod/expect_output.txt b/test/aottest/createobjecthavingmethod/expect_output.txt new file mode 100644 index 0000000000..fbdf0fc9e2 --- /dev/null +++ b/test/aottest/createobjecthavingmethod/expect_output.txt @@ -0,0 +1,14 @@ +# Copyright (c) 2022 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +2 diff --git a/test/aottest/createobjectwithbuffer/BUILD.gn b/test/aottest/createobjectwithbuffer/BUILD.gn index bc75a1b4b2..43de91fc2d 100644 --- a/test/aottest/createobjectwithbuffer/BUILD.gn +++ b/test/aottest/createobjectwithbuffer/BUILD.gn @@ -13,6 +13,6 @@ import("//arkcompiler/ets_runtime/test/test_helper.gni") -host_aot_assert_test_action("createobjectwithbuffer") { +host_aot_test_action("createobjectwithbuffer") { deps = [] } diff --git a/test/aottest/createobjectwithbuffer/createobjectwithbuffer.ts b/test/aottest/createobjectwithbuffer/createobjectwithbuffer.ts index 512724466b..86d664a0bd 100644 --- a/test/aottest/createobjectwithbuffer/createobjectwithbuffer.ts +++ b/test/aottest/createobjectwithbuffer/createobjectwithbuffer.ts @@ -13,13 +13,13 @@ * limitations under the License. */ -declare function assert_equal(a: Object, b: Object):void; +declare function print(str:any):string; let obj:{a:number, b:string}={ a:1, b:"str", } -assert_equal(obj.a, 1); -assert_equal(obj.b, "str"); +print(obj.a); +print(obj.b); class A { data: { @@ -35,7 +35,7 @@ class A { elapsed = 11.1; this.data.elapsed += elapsed; - assert_equal(this.data.elapsed, 11.1); + print(this.data.elapsed) } } diff --git a/test/aottest/createobjectwithbuffer/expect_output.txt b/test/aottest/createobjectwithbuffer/expect_output.txt new file mode 100644 index 0000000000..4825004388 --- /dev/null +++ b/test/aottest/createobjectwithbuffer/expect_output.txt @@ -0,0 +1,16 @@ +# Copyright (c) 2022 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +1 +str +11.1 diff --git a/test/aottest/createobjectwithexcludedkeys/BUILD.gn b/test/aottest/createobjectwithexcludedkeys/BUILD.gn index 66cd2a9159..1356a1e5e9 100644 --- a/test/aottest/createobjectwithexcludedkeys/BUILD.gn +++ b/test/aottest/createobjectwithexcludedkeys/BUILD.gn @@ -13,6 +13,6 @@ import("//arkcompiler/ets_runtime/test/test_helper.gni") -host_aot_assert_test_action("createobjectwithexcludedkeys") { +host_aot_test_action("createobjectwithexcludedkeys") { deps = [] } diff --git a/test/aottest/createobjectwithexcludedkeys/createobjectwithexcludedkeys.ts b/test/aottest/createobjectwithexcludedkeys/createobjectwithexcludedkeys.ts index 6f2c15cf0d..8809bb8651 100644 --- a/test/aottest/createobjectwithexcludedkeys/createobjectwithexcludedkeys.ts +++ b/test/aottest/createobjectwithexcludedkeys/createobjectwithexcludedkeys.ts @@ -14,11 +14,10 @@ */ // CREATEOBJECTWITHEXCLUDEDKEYS_IMM8_V8_V8 -declare function assert_equal(a: Object, b: Object):void; const v0 = {value : 'value', age: 23, name: 'name'}; const {value, age, ...v1} = v0; -assert_equal(value, 'value'); -assert_equal(age, 23); -assert_equal(v1.value, undefined); -assert_equal(v1.age, undefined); -assert_equal(v1.name, 'name'); +print(value); +print(age); +print(v1.value); +print(v1.age); +print(v1.name); diff --git a/test/aottest/createobjectwithexcludedkeys/expect_output.txt b/test/aottest/createobjectwithexcludedkeys/expect_output.txt new file mode 100644 index 0000000000..0212cf4caa --- /dev/null +++ b/test/aottest/createobjectwithexcludedkeys/expect_output.txt @@ -0,0 +1,18 @@ +# Copyright (c) 2022 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +value +23 +undefined +undefined +name diff --git a/test/aottest/createregexpwithliteral/BUILD.gn b/test/aottest/createregexpwithliteral/BUILD.gn index 90e8c788bd..e5a034ee29 100644 --- a/test/aottest/createregexpwithliteral/BUILD.gn +++ b/test/aottest/createregexpwithliteral/BUILD.gn @@ -13,6 +13,6 @@ import("//arkcompiler/ets_runtime/test/test_helper.gni") -host_aot_assert_test_action("createregexpwithliteral") { +host_aot_test_action("createregexpwithliteral") { deps = [] } diff --git a/test/aottest/createregexpwithliteral/createregexpwithliteral.ts b/test/aottest/createregexpwithliteral/createregexpwithliteral.ts index 85902a5600..5417ea5451 100644 --- a/test/aottest/createregexpwithliteral/createregexpwithliteral.ts +++ b/test/aottest/createregexpwithliteral/createregexpwithliteral.ts @@ -13,12 +13,11 @@ * limitations under the License. */ -declare function assert_true(condition: boolean):void; -declare function assert_equal(a: Object, b: Object):void; +declare function print(str:boolean):boolean; var re = /abc+/; var str1 = "abcc"; var str2 = "ac"; var res1 = re.test(str1); var res2 = re.test(str2); -assert_true(res1); -assert_equal(res2, false); \ No newline at end of file +print(res1); +print(res2); \ No newline at end of file diff --git a/test/aottest/createregexpwithliteral/expect_output.txt b/test/aottest/createregexpwithliteral/expect_output.txt new file mode 100644 index 0000000000..1455f704a2 --- /dev/null +++ b/test/aottest/createregexpwithliteral/expect_output.txt @@ -0,0 +1,15 @@ +# Copyright (c) 2022 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +true +false diff --git a/test/aottest/dec/BUILD.gn b/test/aottest/dec/BUILD.gn index 3232b1cd72..b6517bb6a1 100644 --- a/test/aottest/dec/BUILD.gn +++ b/test/aottest/dec/BUILD.gn @@ -13,6 +13,6 @@ import("//arkcompiler/ets_runtime/test/test_helper.gni") -host_aot_assert_test_action("dec") { +host_aot_test_action("dec") { deps = [] } diff --git a/test/aottest/dec/dec.ts b/test/aottest/dec/dec.ts index 477b451ffa..fdaa055fb5 100644 --- a/test/aottest/dec/dec.ts +++ b/test/aottest/dec/dec.ts @@ -13,14 +13,13 @@ * limitations under the License. */ -declare function assert_true(condition: boolean):void; -declare function assert_equal(a: Object, b: Object):void; +declare function print(arg:any):string; let num1:number = 2; -assert_equal(--num1, 1); +print(--num1); let num2:number = 2.1; -assert_equal(--num2, 1.1); +print(--num2); let str:any = "a"; -assert_true(isNaN(--str)); \ No newline at end of file +print(--str); \ No newline at end of file diff --git a/test/aottest/dec/expect_output.txt b/test/aottest/dec/expect_output.txt new file mode 100644 index 0000000000..58f3f077a1 --- /dev/null +++ b/test/aottest/dec/expect_output.txt @@ -0,0 +1,16 @@ +# Copyright (c) 2022 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +1 +1.1 +NaN diff --git a/test/aottest/default_supers/BUILD.gn b/test/aottest/default_supers/BUILD.gn index 21091d8ea0..3286d211bf 100644 --- a/test/aottest/default_supers/BUILD.gn +++ b/test/aottest/default_supers/BUILD.gn @@ -12,6 +12,6 @@ # limitations under the License. import("//arkcompiler/ets_runtime/test/test_helper.gni") -host_aot_assert_test_action("default_supers") { +host_aot_test_action("default_supers") { deps = [] } diff --git a/test/aottest/default_supers/default_supers.ts b/test/aottest/default_supers/default_supers.ts index d0fab8a665..f572f5a085 100644 --- a/test/aottest/default_supers/default_supers.ts +++ b/test/aottest/default_supers/default_supers.ts @@ -12,13 +12,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -declare function assert_equal(a: Object, b: Object):void; class A { a:number = 1; } class B { foo(a : A) { - assert_equal(a.a, undefined); + print(a.a); } } let b = new B(); diff --git a/test/aottest/default_supers/expect_output.txt b/test/aottest/default_supers/expect_output.txt new file mode 100644 index 0000000000..0cc36b9f8e --- /dev/null +++ b/test/aottest/default_supers/expect_output.txt @@ -0,0 +1,18 @@ +# Copyright (c) 2023 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +1 +undefined +2 +undefined +3 diff --git a/test/aottest/defineasyncfunc/BUILD.gn b/test/aottest/defineasyncfunc/BUILD.gn index 193632a382..2e7f1140f9 100644 --- a/test/aottest/defineasyncfunc/BUILD.gn +++ b/test/aottest/defineasyncfunc/BUILD.gn @@ -13,6 +13,6 @@ import("//arkcompiler/ets_runtime/test/test_helper.gni") -host_aot_assert_test_action("defineasyncfunc") { +host_aot_test_action("defineasyncfunc") { deps = [] } diff --git a/test/aottest/defineasyncfunc/expect_output.txt b/test/aottest/defineasyncfunc/expect_output.txt new file mode 100644 index 0000000000..c9cf96b90d --- /dev/null +++ b/test/aottest/defineasyncfunc/expect_output.txt @@ -0,0 +1,15 @@ +# Copyright (c) 2022 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +hello2 +hello1 diff --git a/test/aottest/defineclass/BUILD.gn b/test/aottest/defineclass/BUILD.gn index 22025eb330..d714f1a86e 100644 --- a/test/aottest/defineclass/BUILD.gn +++ b/test/aottest/defineclass/BUILD.gn @@ -13,6 +13,6 @@ import("//arkcompiler/ets_runtime/test/test_helper.gni") -host_aot_js_assert_test_action("defineclass") { +host_aot_js_test_action("defineclass") { deps = [] } diff --git a/test/aottest/defineclass/expect_output.txt b/test/aottest/defineclass/expect_output.txt new file mode 100644 index 0000000000..290a22cc5c --- /dev/null +++ b/test/aottest/defineclass/expect_output.txt @@ -0,0 +1,14 @@ +# Copyright (c) 2023 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +compiler succ diff --git a/test/aottest/defineclasswithbuffer/BUILD.gn b/test/aottest/defineclasswithbuffer/BUILD.gn index 91d975e325..2fb87d2719 100644 --- a/test/aottest/defineclasswithbuffer/BUILD.gn +++ b/test/aottest/defineclasswithbuffer/BUILD.gn @@ -13,6 +13,6 @@ import("//arkcompiler/ets_runtime/test/test_helper.gni") -host_aot_assert_test_action("defineclasswithbuffer") { +host_aot_test_action("defineclasswithbuffer") { deps = [] } diff --git a/test/aottest/defineclasswithbuffer/defineclasswithbuffer.ts b/test/aottest/defineclasswithbuffer/defineclasswithbuffer.ts index a817a83733..7a6bd2481e 100644 --- a/test/aottest/defineclasswithbuffer/defineclasswithbuffer.ts +++ b/test/aottest/defineclasswithbuffer/defineclasswithbuffer.ts @@ -14,9 +14,6 @@ */ declare function print(str:any):string; -declare function assert_unreachable():void; -declare function assert_true(condition: boolean):void; -declare function assert_equal(a: Object, b: Object):void; class Obj1 { value:number; constructor(value:number) { @@ -34,12 +31,12 @@ class Obj2 { } var obj1 = new Obj1(1); -assert_equal(obj1.value, 1); -assert_equal(obj1.fun(2), 4); +print(obj1.value); +print(obj1.fun(2)); var obj2 = new Obj2(); obj2.fun(); -assert_true(obj1 instanceof Object); +print(obj1 instanceof Object); // The following test case once exposed a bug: The abstract methods were not ignored when generating phc using ts types, // resulting in the inconsistency between the properties key and class litreal at runtime. @@ -53,7 +50,7 @@ abstract class C { } } -assert_equal(C.prototype.bar(), "bar"); +print(C.prototype.bar()); function f26() { function f29() {} @@ -62,6 +59,5 @@ function f26() { } try { const v31 = f26(); - assert_unreachable(); } catch (e) {} class C33 {} \ No newline at end of file diff --git a/test/aottest/defineclasswithbuffer/expect_output.txt b/test/aottest/defineclasswithbuffer/expect_output.txt new file mode 100644 index 0000000000..00f1cbd45b --- /dev/null +++ b/test/aottest/defineclasswithbuffer/expect_output.txt @@ -0,0 +1,18 @@ +# Copyright (c) 2022 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +1 +4 +Hello World +true +bar diff --git a/test/aottest/definefunc/BUILD.gn b/test/aottest/definefunc/BUILD.gn index 2c842c4a51..979ab0c63d 100644 --- a/test/aottest/definefunc/BUILD.gn +++ b/test/aottest/definefunc/BUILD.gn @@ -13,6 +13,6 @@ import("//arkcompiler/ets_runtime/test/test_helper.gni") -host_aot_assert_test_action("definefunc") { +host_aot_test_action("definefunc") { deps = [] } diff --git a/test/aottest/definefunc/definefunc.ts b/test/aottest/definefunc/definefunc.ts index 246433dcbf..4130af1528 100644 --- a/test/aottest/definefunc/definefunc.ts +++ b/test/aottest/definefunc/definefunc.ts @@ -14,7 +14,6 @@ */ declare function print(str:string):string; -declare function assert_equal(a: Object, b: Object):void; function getHelloWorld():string { @@ -27,4 +26,4 @@ function printArg(a:any, b:any) print(b); } -assert_equal(getHelloWorld(), "hello world"); \ No newline at end of file +print(getHelloWorld()); \ No newline at end of file diff --git a/test/aottest/definefunc/expect_output.txt b/test/aottest/definefunc/expect_output.txt new file mode 100644 index 0000000000..27bb45d2a8 --- /dev/null +++ b/test/aottest/definefunc/expect_output.txt @@ -0,0 +1,14 @@ +# Copyright (c) 2022 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +hello world diff --git a/test/aottest/definefunc_variable_args/BUILD.gn b/test/aottest/definefunc_variable_args/BUILD.gn index 57d51230e1..9a4daedd74 100644 --- a/test/aottest/definefunc_variable_args/BUILD.gn +++ b/test/aottest/definefunc_variable_args/BUILD.gn @@ -13,6 +13,6 @@ import("//arkcompiler/ets_runtime/test/test_helper.gni") -host_aot_assert_test_action("definefunc_variable_args") { +host_aot_test_action("definefunc_variable_args") { deps = [] } diff --git a/test/aottest/definefunc_variable_args/definefunc_variable_args.ts b/test/aottest/definefunc_variable_args/definefunc_variable_args.ts index 899a08e655..627b8492ae 100644 --- a/test/aottest/definefunc_variable_args/definefunc_variable_args.ts +++ b/test/aottest/definefunc_variable_args/definefunc_variable_args.ts @@ -14,12 +14,11 @@ */ declare function print(str:string):string; -declare function assert_equal(a: Object, b: Object):void; function printArgs(...rest:any) { - assert_equal(arguments[0], "aaa"); - assert_equal(arguments[1], 55555); + print(arguments[0]); + print(arguments[1]); } printArgs("aaa", 55555); \ No newline at end of file diff --git a/test/aottest/definefunc_variable_args/expect_output.txt b/test/aottest/definefunc_variable_args/expect_output.txt new file mode 100644 index 0000000000..747c7722ef --- /dev/null +++ b/test/aottest/definefunc_variable_args/expect_output.txt @@ -0,0 +1,15 @@ +# Copyright (c) 2022 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +aaa +55555