diff --git a/plugins/ets/doc/spec/15_semantics.rst b/plugins/ets/doc/spec/15_semantics.rst index ed89d7e041baa873ff12596bef5a9ee8f8973d19..6239a483be76e8181749cfc7718b68dc3ba572bb 100644 --- a/plugins/ets/doc/spec/15_semantics.rst +++ b/plugins/ets/doc/spec/15_semantics.rst @@ -231,6 +231,9 @@ while doing the |LANG| programming. Extended Conditional Expressions ================================ +.. meta: + frontend_status: Done + |LANG| provides extended semantics for conditional-and and conditional-or expressions for better alignment. It affects the semantics of conditional expressions (see :ref:`Conditional Expressions`), ``while`` statements and diff --git a/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/addition/add_arr_ref.ets b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/addition/add_arr_ref.ets new file mode 100644 index 0000000000000000000000000000000000000000..79dcc3577f4fcc1db0c852dda4402b660e42c38d --- /dev/null +++ b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/addition/add_arr_ref.ets @@ -0,0 +1,31 @@ +/*--- +Copyright (c) 2021-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. +---*/ +{%- for v in vals %} +/*--- +desc: >- + ArkTS provides a number of operators to act on character values: + Character operators that produce a value of type char. +---*/ + +const a: Char[] = new Char[1] + +function main() { + const v1 = new Char({{v.v1}}) + const v2 = new Char({{v.v2}}) + + a[0] = {{v.exp}} // unboxing/boxing is expected here + assert a[0] == {{v.r}} +} +{%- endfor %} diff --git a/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/addition/add_arr_ref.params.yaml b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/addition/add_arr_ref.params.yaml new file mode 100644 index 0000000000000000000000000000000000000000..d0417a7407e3efe00fdbc4ddce612d061de72902 --- /dev/null +++ b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/addition/add_arr_ref.params.yaml @@ -0,0 +1,48 @@ +# Copyright (c) 2021-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. +--- +vals: + - v1: c'\u0020' + v2: c'\u0021' + exp: 'v1 + v2' + r: c'A' + + - v1: c'\u0020' + v2: c'\u0001' + exp: "v1 + v2 + c' '" + r: c'A' + + - v1: c'\uFFFF' + v2: c'\uFFFF' + exp: "v1 + v2" + r: c'\uFFFE' + + - v1: c'\uFFFF' + v2: c'\u0001' + exp: "v1 + v2" + r: c'\u0000' + + - v1: c'\uFFFF' + v2: c'\u000F' + exp: "v1 + c'\\u000F'" + r: c'\u000E' + + - v1: c'\u1010' + v2: c'\u0101' + exp: "v1 + c'\\u1010' + v2 + c'\\u0101'" + r: c'\u2222' + + - v1: c'∫' + v2: c'\x01' + exp: "v1 + v2" + r: c'∬' diff --git a/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/addition/add_arr_val.ets b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/addition/add_arr_val.ets new file mode 100644 index 0000000000000000000000000000000000000000..889f670f9160b83a62706cc2f6372898a6b3d3b8 --- /dev/null +++ b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/addition/add_arr_val.ets @@ -0,0 +1,31 @@ +/*--- +Copyright (c) 2021-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. +---*/ +{%- for v in vals %} +/*--- +desc: >- + ArkTS provides a number of operators to act on character values: + Character operators that produce a value of type char. +---*/ + +const a: char[] = new char[1] + +function main() { + const v1 = {{v.v1}} + const v2 = {{v.v2}} + + a[0] = {{v.exp}} + assert a[0] == {{v.r}} +} +{%- endfor %} diff --git a/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/addition/add_arr_val.params.yaml b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/addition/add_arr_val.params.yaml new file mode 100644 index 0000000000000000000000000000000000000000..d0417a7407e3efe00fdbc4ddce612d061de72902 --- /dev/null +++ b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/addition/add_arr_val.params.yaml @@ -0,0 +1,48 @@ +# Copyright (c) 2021-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. +--- +vals: + - v1: c'\u0020' + v2: c'\u0021' + exp: 'v1 + v2' + r: c'A' + + - v1: c'\u0020' + v2: c'\u0001' + exp: "v1 + v2 + c' '" + r: c'A' + + - v1: c'\uFFFF' + v2: c'\uFFFF' + exp: "v1 + v2" + r: c'\uFFFE' + + - v1: c'\uFFFF' + v2: c'\u0001' + exp: "v1 + v2" + r: c'\u0000' + + - v1: c'\uFFFF' + v2: c'\u000F' + exp: "v1 + c'\\u000F'" + r: c'\u000E' + + - v1: c'\u1010' + v2: c'\u0101' + exp: "v1 + c'\\u1010' + v2 + c'\\u0101'" + r: c'\u2222' + + - v1: c'∫' + v2: c'\x01' + exp: "v1 + v2" + r: c'∬' diff --git a/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/addition/add_func_ref.ets b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/addition/add_func_ref.ets new file mode 100644 index 0000000000000000000000000000000000000000..96b9fe2a38f1c080d5bdddf837213a962cec4a49 --- /dev/null +++ b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/addition/add_func_ref.ets @@ -0,0 +1,32 @@ +/*--- +Copyright (c) 2021-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. +---*/ +{%- for v in vals %} +/*--- +desc: >- + ArkTS provides a number of operators to act on character values: + Character operators that produce a value of type char. +---*/ + +function add(p: Char, q: Char): Char { + return p + q // unboxing/boxing is expected here +} + +function main() { + const v1 = new Char({{v.v1}}) + const v2 = new Char({{v.v2}}) + + assert ({{v.exp}}) == {{v.r}} +} +{%- endfor %} diff --git a/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/addition/add_func_ref.params.yaml b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/addition/add_func_ref.params.yaml new file mode 100644 index 0000000000000000000000000000000000000000..86a19326c9441202c86aadfb149cf37e281996ff --- /dev/null +++ b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/addition/add_func_ref.params.yaml @@ -0,0 +1,48 @@ +# Copyright (c) 2021-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. +--- +vals: + - v1: c'\u0020' + v2: c'\u0021' + exp: 'add(v1, v2)' + r: c'A' + + - v1: c'\u0020' + v2: c'\u0001' + exp: "add(v1, v2) + c' '" + r: c'A' + + - v1: c'\uFFFF' + v2: c'\uFFFF' + exp: "add(v1, v2)" + r: c'\uFFFE' + + - v1: c'\uFFFF' + v2: c'\u0001' + exp: "add(v1, v2)" + r: c'\u0000' + + - v1: c'\uFFFF' + v2: c'\u000F' + exp: "add(v1, c'\\u000F')" + r: c'\u000E' + + - v1: c'\u1010' + v2: c'\u0101' + exp: "add(v1 + c'\\u1010', v2 + c'\\u0101')" + r: c'\u2222' + + - v1: c'∫' + v2: c'\x01' + exp: "add(v1, v2)" + r: c'∬' diff --git a/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/addition/add_func_val.ets b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/addition/add_func_val.ets new file mode 100644 index 0000000000000000000000000000000000000000..3e2ef0d2773951a83f85592a772b52a01ae2cdd7 --- /dev/null +++ b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/addition/add_func_val.ets @@ -0,0 +1,32 @@ +/*--- +Copyright (c) 2021-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. +---*/ +{%- for v in vals %} +/*--- +desc: >- + ArkTS provides a number of operators to act on character values: + Character operators that produce a value of type char. +---*/ + +function add(p: char, q: char): char { + return p + q +} + +function main() { + const v1 = {{v.v1}} + const v2 = {{v.v2}} + + assert ({{v.exp}}) == {{v.r}} +} +{%- endfor %} diff --git a/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/addition/add_func_val.params.yaml b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/addition/add_func_val.params.yaml new file mode 100644 index 0000000000000000000000000000000000000000..86a19326c9441202c86aadfb149cf37e281996ff --- /dev/null +++ b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/addition/add_func_val.params.yaml @@ -0,0 +1,48 @@ +# Copyright (c) 2021-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. +--- +vals: + - v1: c'\u0020' + v2: c'\u0021' + exp: 'add(v1, v2)' + r: c'A' + + - v1: c'\u0020' + v2: c'\u0001' + exp: "add(v1, v2) + c' '" + r: c'A' + + - v1: c'\uFFFF' + v2: c'\uFFFF' + exp: "add(v1, v2)" + r: c'\uFFFE' + + - v1: c'\uFFFF' + v2: c'\u0001' + exp: "add(v1, v2)" + r: c'\u0000' + + - v1: c'\uFFFF' + v2: c'\u000F' + exp: "add(v1, c'\\u000F')" + r: c'\u000E' + + - v1: c'\u1010' + v2: c'\u0101' + exp: "add(v1 + c'\\u1010', v2 + c'\\u0101')" + r: c'\u2222' + + - v1: c'∫' + v2: c'\x01' + exp: "add(v1, v2)" + r: c'∬' diff --git a/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/ch.ets b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/ch.ets new file mode 100644 index 0000000000000000000000000000000000000000..4910c45ba1fafb4259061a50f136808e4bb769dc --- /dev/null +++ b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/ch.ets @@ -0,0 +1,24 @@ +/*--- +Copyright (c) 2021-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. +---*/ + +{% for c in cases %} +/*--- +desc: check addition of two bytes +---*/ + +function main() { + const v = {{c.exp}} +} +{% endfor %} diff --git a/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/ch.params.yaml b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/ch.params.yaml new file mode 100644 index 0000000000000000000000000000000000000000..959ed0774bd882d4927ce028b72ff1a88f60f904 --- /dev/null +++ b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/ch.params.yaml @@ -0,0 +1,20 @@ +# Copyright (c) 2021-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. + +--- +cases: + - exp: c'2' & c'2' + - exp: c'2' && c'2' + - exp: c'2' | c'2' + - exp: c'2' || c'2' + - exp: "!c'2' && !c'2'" diff --git a/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/ch_n.ets b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/ch_n.ets new file mode 100644 index 0000000000000000000000000000000000000000..4ca18822978a428003250199184552af0023dcf5 --- /dev/null +++ b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/ch_n.ets @@ -0,0 +1,25 @@ +/*--- +Copyright (c) 2021-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. +---*/ + +{% for c in cases %} +/*--- +desc: check addition of two bytes +tags: [compile-only, negative] +---*/ + +function main() { + const v = {{c.exp}} +} +{% endfor %} diff --git a/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/ch_n.params.yaml b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/ch_n.params.yaml new file mode 100644 index 0000000000000000000000000000000000000000..76f3a63d6af59c57bd3addac35ea03bd6e06e153 --- /dev/null +++ b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/ch_n.params.yaml @@ -0,0 +1,22 @@ +# Copyright (c) 2021-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. + +--- +cases: + - exp: c'0' * c'2' + - exp: c'1' / c'1' + - exp: c'2' % c'2' + - exp: c'2' >> c'2' + - exp: c'2' >>> c'2' + - exp: c'2' << c'2' + - exp: c'2' ^ c'2' diff --git a/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/comparison/cmp_ref.ets b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/comparison/cmp_ref.ets new file mode 100644 index 0000000000000000000000000000000000000000..c744a32bd93d3ed4ed5edec5bbc3e62fa04af3e2 --- /dev/null +++ b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/comparison/cmp_ref.ets @@ -0,0 +1,30 @@ +/*--- +Copyright (c) 2021-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. +---*/ +{%- for v in vals %} +/*--- +desc: >- + ArkTS provides a number of operators to act on character values: + Comparison operators that produce a value of type boolean. +---*/ + +function main() { + const v1: Char = new Char({{v.v1}}) + const v2: Char = new Char({{v.v2}}) + + {%- for c in v.cases %} + assert (v1 {{c.op}} v2) == {{c.r}} + {%- endfor %} +} +{%- endfor %} diff --git a/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/comparison/cmp_ref.params.yaml b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/comparison/cmp_ref.params.yaml new file mode 100644 index 0000000000000000000000000000000000000000..432850f238a6c8d1669556041cdd45df78e547e6 --- /dev/null +++ b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/comparison/cmp_ref.params.yaml @@ -0,0 +1,53 @@ +# Copyright (c) 2021-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. +--- +vals: + - v1: c'\u0000' + v2: c'\u0000' + cases: + - { op: '==', r: 'true' } + - { op: '!=', r: 'false' } + - { op: '<', r: 'false' } + - { op: '<=', r: 'true' } + - { op: '>', r: 'false' } + - { op: '>=', r: 'true' } + + - v1: c'\uFFFF' + v2: c'\uFFFF' + cases: + - { op: '==', r: 'true' } + - { op: '!=', r: 'false' } + - { op: '<', r: 'false' } + - { op: '<=', r: 'true' } + - { op: '>', r: 'false' } + - { op: '>=', r: 'true' } + + - v1: c'\u000F' + v2: c'\uF000' + cases: + - { op: '==', r: 'false' } + - { op: '!=', r: 'true' } + - { op: '<', r: 'true' } + - { op: '<=', r: 'true' } + - { op: '>', r: 'false' } + - { op: '>=', r: 'false' } + + - v1: c'\u0100' + v2: c'\u00FF' + cases: + - { op: '==', r: 'false' } + - { op: '!=', r: 'true' } + - { op: '<', r: 'false' } + - { op: '<=', r: 'false' } + - { op: '>', r: 'true' } + - { op: '>=', r: 'true' } diff --git a/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/comparison/cmp_val.ets b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/comparison/cmp_val.ets new file mode 100644 index 0000000000000000000000000000000000000000..08b6bcae9305ba6af01322ffff2cf0e71a939f5e --- /dev/null +++ b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/comparison/cmp_val.ets @@ -0,0 +1,30 @@ +/*--- +Copyright (c) 2021-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. +---*/ +{%- for v in vals %} +/*--- +desc: >- + ArkTS provides a number of operators to act on character values: + Comparison operators that produce a value of type boolean. +---*/ + +function main() { + const v1: char = {{v.v1}} + const v2: char = {{v.v2}} + + {%- for c in v.cases %} + assert (v1 {{c.op}} v2) == {{c.r}} + {%- endfor %} +} +{%- endfor %} diff --git a/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/comparison/cmp_val.params.yaml b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/comparison/cmp_val.params.yaml new file mode 100644 index 0000000000000000000000000000000000000000..432850f238a6c8d1669556041cdd45df78e547e6 --- /dev/null +++ b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/comparison/cmp_val.params.yaml @@ -0,0 +1,53 @@ +# Copyright (c) 2021-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. +--- +vals: + - v1: c'\u0000' + v2: c'\u0000' + cases: + - { op: '==', r: 'true' } + - { op: '!=', r: 'false' } + - { op: '<', r: 'false' } + - { op: '<=', r: 'true' } + - { op: '>', r: 'false' } + - { op: '>=', r: 'true' } + + - v1: c'\uFFFF' + v2: c'\uFFFF' + cases: + - { op: '==', r: 'true' } + - { op: '!=', r: 'false' } + - { op: '<', r: 'false' } + - { op: '<=', r: 'true' } + - { op: '>', r: 'false' } + - { op: '>=', r: 'true' } + + - v1: c'\u000F' + v2: c'\uF000' + cases: + - { op: '==', r: 'false' } + - { op: '!=', r: 'true' } + - { op: '<', r: 'true' } + - { op: '<=', r: 'true' } + - { op: '>', r: 'false' } + - { op: '>=', r: 'false' } + + - v1: c'\u0100' + v2: c'\u00FF' + cases: + - { op: '==', r: 'false' } + - { op: '!=', r: 'true' } + - { op: '<', r: 'false' } + - { op: '<=', r: 'false' } + - { op: '>', r: 'true' } + - { op: '>=', r: 'true' } diff --git a/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/concat/conc2.ets b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/concat/conc2.ets new file mode 100644 index 0000000000000000000000000000000000000000..c2bfe78216dd7be4a0585bb87a402d9f2ddbbf43 --- /dev/null +++ b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/concat/conc2.ets @@ -0,0 +1,25 @@ +/*--- +Copyright (c) 2021-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. +---*/ +/*--- +desc: >- + The string concatenation operator '+' (see String Concatenation), which (if a string operand and character + operand are available) converts the character operand to a string and then creates a concatenation of + the two strings as a new string. +---*/ +function main() { +{%- for v in vals %} + assert {{v.expr}} == {{v.res}} +{%- endfor %} +} diff --git a/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/concat/conc2.params.yaml b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/concat/conc2.params.yaml new file mode 100644 index 0000000000000000000000000000000000000000..aa7474f3a426f69fea204a3cb6296f84feb542a5 --- /dev/null +++ b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/concat/conc2.params.yaml @@ -0,0 +1,39 @@ +# Copyright (c) 2021-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. +--- +vals: + - expr: "'a' + c'b' + 'c' + c'd'" + res: '"abcd"' + - expr: "'a' + c'b' + c'c' + c'd'" + res: '"abcd"' + - expr: "c'a' + 'b' + 'c' + c'd'" + res: '"abcd"' + - expr: "c'a' + c'b' + c'c' + c'd'" + res: c'Ɗ' + - expr: "c'a' + c'b' + c'c' + 'd'" + res: '"Ħd"' + - expr: "c'a' + c'b' + 'c' + 'd'" + res: '"Ãcd"' + + - expr: "'a' + new Char(c'b') + 'c' + new Char(c'd')" + res: '"abcd"' + - expr: "'a' + new Char(c'b') + new Char(c'c') + new Char(c'd')" + res: '"abcd"' + - expr: "new Char(c'a') + 'b' + 'c' + new Char(c'd')" + res: '"abcd"' + - expr: "new Char(c'a') + new Char(c'b') + new Char(c'c') + new Char(c'd')" + res: c'Ɗ' + - expr: "new Char(c'a') + new Char(c'b') + new Char(c'c') + 'd'" + res: '"Ħd"' + - expr: "new Char(c'a') + new Char(c'b') + 'c' + 'd'" + res: '"Ãcd"' diff --git a/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/concat/conc_ref.ets b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/concat/conc_ref.ets new file mode 100644 index 0000000000000000000000000000000000000000..173bea5493cbb8a52f1cf1248d1451ec95ab95d9 --- /dev/null +++ b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/concat/conc_ref.ets @@ -0,0 +1,38 @@ +/*--- +Copyright (c) 2021-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. +---*/ +{%- for v in vals %} +/*--- +desc: >- + The string concatenation operator '+' (see String Concatenation), which (if a string operand and character + operand are available) converts the character operand to a string and then creates a concatenation of + the two strings as a new string. +---*/ +function main() { + const v1 = new Char({{v.v1}}) + const v2 = new Char({{v.v2}}) + + assert "" + v1 + v2 == {{v.r1}} + assert v1 + "" + v2 == {{v.r1}} + assert v1 + v2 + "" == {{v.r2}} + + assert "" + {{v.v1}} + v2 == {{v.r1}} + assert {{v.v1}} + "" + v2 == {{v.r1}} + assert {{v.v1}} + v2 + "" == {{v.r2}} + + assert "" + {{v.v1}} + {{v.v2}} == {{v.r1}} + assert {{v.v1}} + "" + {{v.v2}} == {{v.r1}} + assert {{v.v1}} + {{v.v2}} + "" == {{v.r2}} +} +{%- endfor %} diff --git a/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/concat/conc_ref.params.yaml b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/concat/conc_ref.params.yaml new file mode 100644 index 0000000000000000000000000000000000000000..157a114e3368e5651bb7727aef37eb9a30bcd092 --- /dev/null +++ b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/concat/conc_ref.params.yaml @@ -0,0 +1,38 @@ +# Copyright (c) 2021-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. +--- +vals: + - v1: c'\u0020' + v2: c'\u0021' + r1: '" !"' + r2: '"A"' + + - v1: c'\uFFFF' + v2: c'\uFFFF' + r1: '"\uFFFF\uFFFF"' + r2: '"\uFFFE"' + + - v1: c'\uFFFF' + v2: c'\u0000' + r1: '"\uFFFF\u0000"' + r2: '"\uFFFF"' + + - v1: c'\u2200' + v2: c'\u002C' + r1: '"∀,"' + r2: '"∬"' + + - v1: c'1' + v2: c'2' + r1: '"12"' + r2: '"c"' diff --git a/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/concat/conc_val.ets b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/concat/conc_val.ets new file mode 100644 index 0000000000000000000000000000000000000000..536ea8f31f5e8afcf40e72eed5ae0774500357e6 --- /dev/null +++ b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/concat/conc_val.ets @@ -0,0 +1,38 @@ +/*--- +Copyright (c) 2021-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. +---*/ +{%- for v in vals %} +/*--- +desc: >- + The string concatenation operator '+' (see String Concatenation), which (if a string operand and character + operand are available) converts the character operand to a string and then creates a concatenation of + the two strings as a new string. +---*/ +function main() { + let v1 = {{v.v1}} + let v2 = {{v.v2}} + + assert "" + v1 + v2 == {{v.r1}} + assert v1 + "" + v2 == {{v.r1}} + assert v1 + v2 + "" == {{v.r2}} + + assert "" + {{v.v1}} + v2 == {{v.r1}} + assert {{v.v1}} + "" + v2 == {{v.r1}} + assert {{v.v1}} + v2 + "" == {{v.r2}} + + assert "" + {{v.v1}} + {{v.v2}} == {{v.r1}} + assert {{v.v1}} + "" + {{v.v2}} == {{v.r1}} + assert {{v.v1}} + {{v.v2}} + "" == {{v.r2}} +} +{%- endfor %} diff --git a/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/concat/conc_val.params.yaml b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/concat/conc_val.params.yaml new file mode 100644 index 0000000000000000000000000000000000000000..157a114e3368e5651bb7727aef37eb9a30bcd092 --- /dev/null +++ b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/concat/conc_val.params.yaml @@ -0,0 +1,38 @@ +# Copyright (c) 2021-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. +--- +vals: + - v1: c'\u0020' + v2: c'\u0021' + r1: '" !"' + r2: '"A"' + + - v1: c'\uFFFF' + v2: c'\uFFFF' + r1: '"\uFFFF\uFFFF"' + r2: '"\uFFFE"' + + - v1: c'\uFFFF' + v2: c'\u0000' + r1: '"\uFFFF\u0000"' + r2: '"\uFFFF"' + + - v1: c'\u2200' + v2: c'\u002C' + r1: '"∀,"' + r2: '"∬"' + + - v1: c'1' + v2: c'2' + r1: '"12"' + r2: '"c"' diff --git a/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/conditional/cond_exp_val.ets b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/conditional/cond_exp_val.ets new file mode 100644 index 0000000000000000000000000000000000000000..61004b7e214f9cc7ee48db6e1f6e0b8c8e463d0a --- /dev/null +++ b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/conditional/cond_exp_val.ets @@ -0,0 +1,30 @@ +/*--- +Copyright (c) 2021-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. +---*/ +{%- for v in vals %} +/*--- +desc: >- + ArkTS provides a number of operators to act on character values: + Conditional operator ‘?:’ (see Conditional Expressions); +---*/ + +class A { + static b: boolean = {{v.b}} + static r: char = {{v.r}} +} + +function main() { + assert A.r - (A.b ? {{v.v1}} : {{v.v2}}) == c'\u0000' +} +{%- endfor %} diff --git a/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/conditional/cond_exp_val.params.yaml b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/conditional/cond_exp_val.params.yaml new file mode 100644 index 0000000000000000000000000000000000000000..b0dbf41ae03ec1c29f15d0a19b0158939964c650 --- /dev/null +++ b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/conditional/cond_exp_val.params.yaml @@ -0,0 +1,34 @@ +# Copyright (c) 2021-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. +--- +vals: + - v1: c'\u0020' + v2: c'\u0021' + b: 'true' + r: c' ' + + - v1: c'\u0020' + v2: c'\uF041' + b: 'false' + r: c'A' + c'\uF000' + + - v1: c'\uFFFE' + c'\u0023' + v2: c'\u0021' + c'\u0001' + b: 'true' + r: c'!' + + - v1: 65535 as char + v2: 65534 as char + b: 'true' + r: c'\uFFFF' + diff --git a/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/conditional/cond_fld_val.ets b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/conditional/cond_fld_val.ets new file mode 100644 index 0000000000000000000000000000000000000000..610e3a70a76c960f7797888a3fa4c0b19eff2ac5 --- /dev/null +++ b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/conditional/cond_fld_val.ets @@ -0,0 +1,32 @@ +/*--- +Copyright (c) 2021-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. +---*/ +{%- for v in vals %} +/*--- +desc: >- + ArkTS provides a number of operators to act on character values: + Conditional operator ‘?:’ (see Conditional Expressions); +---*/ + +class A { + static b: boolean = {{v.b}} + static v1: char = {{v.v1}} + static v2: char = {{v.v2}} + static r: char = {{v.r}} +} + +function main() { + assert (A.b ? A.v1 : A.v2) == A.r +} +{%- endfor %} diff --git a/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/conditional/cond_fld_val.params.yaml b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/conditional/cond_fld_val.params.yaml new file mode 100644 index 0000000000000000000000000000000000000000..b94ed9f6a9abd8530c42270cca22292d1dc346cd --- /dev/null +++ b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/conditional/cond_fld_val.params.yaml @@ -0,0 +1,28 @@ +# Copyright (c) 2021-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. +--- +vals: + - v1: c'\u0020' + v2: c'\u0021' + b: 'true' + r: c' ' + + - v1: c'\u0020' + v2: c'\uF041' + b: 'false' + r: c'A' + c'\uF000' + + - v1: c'\uFFFE' + c'\u0023' + v2: c'\u0021' + c'\u0001' + b: 'true' + r: c'!' diff --git a/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/conditional/cond_func_ref.ets b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/conditional/cond_func_ref.ets new file mode 100644 index 0000000000000000000000000000000000000000..ebcefaf9b48b59d613c0dd284b35755cd0e5db36 --- /dev/null +++ b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/conditional/cond_func_ref.ets @@ -0,0 +1,32 @@ +/*--- +Copyright (c) 2021-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. +---*/ +{%- for v in vals %} +/*--- +desc: >- + ArkTS provides a number of operators to act on character values: + Conditional operator ‘?:’ (see Conditional Expressions); +---*/ + +function foo(c: boolean, p: Char, q: Char): Char { + return c ? p : q +} + +function main() { + const v1 = new Char({{v.v1}}) + const v2 = new Char({{v.v2}}) + + assert ({{v.exp}}) == {{v.r}} +} +{%- endfor %} diff --git a/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/conditional/cond_func_ref.params.yaml b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/conditional/cond_func_ref.params.yaml new file mode 100644 index 0000000000000000000000000000000000000000..987a257599f2d925f2d89efa7aadc47510858e53 --- /dev/null +++ b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/conditional/cond_func_ref.params.yaml @@ -0,0 +1,38 @@ +# Copyright (c) 2021-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. +--- +vals: + - v1: c'\u0020' + v2: c'\u0021' + exp: foo(true, v1, v2) + r: c' ' + + - v1: c'\u0020' + v2: c'\u0021' + exp: foo(false, v1, v2) + v1 + r: c'A' + + - v1: c'\u0020' + v2: c'\u0021' + exp: '" " + foo(false, v1, v2) + v1' + r: "' ! '" + + - v1: c'\u0020' + v2: c'\u0021' + exp: "c' ' + foo(false, v1, v2) + v1" + r: c'a' + + - v1: c'\u0020' + v2: c'\u0021' + exp: "c' ' + foo(false, v2 + v1, v2 - v1)" + r: v2 diff --git a/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/conditional/cond_func_val.ets b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/conditional/cond_func_val.ets new file mode 100644 index 0000000000000000000000000000000000000000..af27bd37b6ea1b270c4eece153d79c55827ad621 --- /dev/null +++ b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/conditional/cond_func_val.ets @@ -0,0 +1,32 @@ +/*--- +Copyright (c) 2021-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. +---*/ +{%- for v in vals %} +/*--- +desc: >- + ArkTS provides a number of operators to act on character values: + Conditional operator ‘?:’ (see Conditional Expressions); +---*/ + +function foo(c: boolean, p: char, q: char): char { + return c ? p : q +} + +function main() { + const v1 = {{v.v1}} + const v2 = {{v.v2}} + + assert ({{v.exp}}) == {{v.r}} +} +{%- endfor %} diff --git a/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/conditional/cond_func_val.params.yaml b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/conditional/cond_func_val.params.yaml new file mode 100644 index 0000000000000000000000000000000000000000..9c11aa0213933760135e1eb752ede5c6c9563b46 --- /dev/null +++ b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/conditional/cond_func_val.params.yaml @@ -0,0 +1,38 @@ +# Copyright (c) 2021-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. +--- +vals: + - v1: c'\u0020' + v2: c'\u0021' + exp: foo(true, v1, v2) + r: c' ' + + - v1: c'\u0020' + v2: c'\u0021' + exp: foo(false, v1, v2) + v + r: c'A' + + - v1: c'\u0020' + v2: c'\u0021' + exp: '" " + foo(false, v1, v2) + v1' + r: ' ! ' + + - v1: c'\u0020' + v2: c'\u0021' + exp: "c' ' + foo(false, v1, v2) + v1" + r: c'a' + + - v1: c'\u0020' + v2: c'\u0021' + exp: "c' ' + foo(false, v2 + v1, v2 - v1)" + r: v2 diff --git a/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/decrement/dec_arr_ref.ets b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/decrement/dec_arr_ref.ets new file mode 100644 index 0000000000000000000000000000000000000000..2bcacfe64bb33648165f96ce0a460255dc5b2872 --- /dev/null +++ b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/decrement/dec_arr_ref.ets @@ -0,0 +1,34 @@ +/*--- +Copyright (c) 2021-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. +---*/ +{%- for v in vals %} +/*--- +desc: >- + ArkTS provides a number of operators to act on character values: + Character operators that produce a value of type char. +---*/ + +const a: Char[] = new Char[2] + +function main() { + let v1 = new Char({{v.v1}}) + + a[0] = --v1 + v1-- + a[1] = v1 + + assert a[0] == {{v.r1}} + assert a[1] == {{v.r2}} +} +{%- endfor %} diff --git a/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/decrement/dec_arr_ref.params.yaml b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/decrement/dec_arr_ref.params.yaml new file mode 100644 index 0000000000000000000000000000000000000000..e1cf92dcecc509034befff33703a0920ec3f25ed --- /dev/null +++ b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/decrement/dec_arr_ref.params.yaml @@ -0,0 +1,33 @@ +# Copyright (c) 2021-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. +--- +vals: + - v1: c'\u0022' + r1: c'!' + r2: c' ' + + - v1: c'\x00' + r1: c'\uFFFF' + r2: c'\uFFFE' + + - v1: c'\u1110' + r1: c'\u110F' + r2: c'\u110E' + + - v1: c'\u0001' + r1: c'\u0000' + r2: c'\uFFFF' + + - v1: c'∭' + r1: c'∬' + r2: c'∫' diff --git a/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/decrement/dec_arr_val.ets b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/decrement/dec_arr_val.ets new file mode 100644 index 0000000000000000000000000000000000000000..f8eaca85e3e38712318ff00608022afc25a36008 --- /dev/null +++ b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/decrement/dec_arr_val.ets @@ -0,0 +1,34 @@ +/*--- +Copyright (c) 2021-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. +---*/ +{%- for v in vals %} +/*--- +desc: >- + ArkTS provides a number of operators to act on character values: + Character operators that produce a value of type char. +---*/ + +const a: char[] = new char[2] + +function main() { + let v1 = {{v.v1}} + + a[0] = --v1 + v1-- + a[1] = v1 + + assert a[0] == {{v.r1}} + assert a[1] == {{v.r2}} +} +{%- endfor %} diff --git a/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/decrement/dec_arr_val.params.yaml b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/decrement/dec_arr_val.params.yaml new file mode 100644 index 0000000000000000000000000000000000000000..e1cf92dcecc509034befff33703a0920ec3f25ed --- /dev/null +++ b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/decrement/dec_arr_val.params.yaml @@ -0,0 +1,33 @@ +# Copyright (c) 2021-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. +--- +vals: + - v1: c'\u0022' + r1: c'!' + r2: c' ' + + - v1: c'\x00' + r1: c'\uFFFF' + r2: c'\uFFFE' + + - v1: c'\u1110' + r1: c'\u110F' + r2: c'\u110E' + + - v1: c'\u0001' + r1: c'\u0000' + r2: c'\uFFFF' + + - v1: c'∭' + r1: c'∬' + r2: c'∫' diff --git a/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/decrement/dec_func_ref.ets b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/decrement/dec_func_ref.ets new file mode 100644 index 0000000000000000000000000000000000000000..422f0c7e5d30ac50a4a5d7aaeba581d1c58c5b87 --- /dev/null +++ b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/decrement/dec_func_ref.ets @@ -0,0 +1,36 @@ +/*--- +Copyright (c) 2021-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. +---*/ +{%- for v in vals %} +/*--- +desc: >- + ArkTS provides a number of operators to act on character values: + Character operators that produce a value of type char. +---*/ + +function decPre(p: Char): Char { + return --p +} + +function decPost(p: Char): Char { + p-- + return p +} + +function main() { + const v1 = new Char({{v.v1}}) + + assert ({{v.exp}}) == {{v.res}} +} +{%- endfor %} diff --git a/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/decrement/dec_func_ref.params.yaml b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/decrement/dec_func_ref.params.yaml new file mode 100644 index 0000000000000000000000000000000000000000..48363f1ce9e36a80fb6322187615d1833b5d55d7 --- /dev/null +++ b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/decrement/dec_func_ref.params.yaml @@ -0,0 +1,69 @@ +# Copyright (c) 2021-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. +--- +vals: + - v1: c'\u0021' + exp: 'decPre(v1)' + res: c' ' + + - v1: c'\u0022' + exp: 'decPost(v1)' + res: c'!' + + - v1: c'"' + exp: "c' ' + decPre(v1)" + res: c'A' + + - v1: c'\u0020' + exp: "c' ' + decPost(v1)" + res: c'?' + + - v1: c'\u0000' + exp: "decPre(v1)" + res: c'\uFFFF' + + - v1: c'\u0000' + exp: "decPost(v1)" + res: c'\uFFFF' + + - v1: c'\u00FF' + exp: "decPre(c'!' + v1 + v1)" + res: c'\u021E' + + - v1: c'\u0001' + exp: "decPost(v1 - c'!' - v1)" + res: c'\uFFDE' + + - v1: c'\u0F0F' + exp: "decPre(v1 - c'1') - decPre(c'\\uACD9')" + res: c'\u6205' + + - v1: c'\u0F0F' + exp: "decPost(v1 + c'1') + decPost(c'\\uACD9')" + res: c'\uBC17' + + - v1: c'\u1110' + exp: "decPre(c'\\u0000') - decPre(v1)" + res: c'\uEEF0' + + - v1: c'\u1000' + exp: "decPost(c'\\u0000') - decPost(v1)" + res: c'\uF000' + + - v1: c'∬' + exp: "decPre(v1)" + res: c'∫' + + - v1: c'∬' + exp: "decPost(v1)" + res: c'∫' diff --git a/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/decrement/dec_func_val.ets b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/decrement/dec_func_val.ets new file mode 100644 index 0000000000000000000000000000000000000000..32e4a17ac617296bbd021b555ffff7315f2664bf --- /dev/null +++ b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/decrement/dec_func_val.ets @@ -0,0 +1,36 @@ +/*--- +Copyright (c) 2021-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. +---*/ +{%- for v in vals %} +/*--- +desc: >- + ArkTS provides a number of operators to act on character values: + Character operators that produce a value of type char. +---*/ + +function decPre(p: char): char { + return --p +} + +function decPost(p: char): char { + p-- + return p +} + +function main() { + const v1 = {{v.v1}} + + assert ({{v.exp}}) == {{v.res}} +} +{%- endfor %} diff --git a/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/decrement/dec_func_val.params.yaml b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/decrement/dec_func_val.params.yaml new file mode 100644 index 0000000000000000000000000000000000000000..48363f1ce9e36a80fb6322187615d1833b5d55d7 --- /dev/null +++ b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/decrement/dec_func_val.params.yaml @@ -0,0 +1,69 @@ +# Copyright (c) 2021-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. +--- +vals: + - v1: c'\u0021' + exp: 'decPre(v1)' + res: c' ' + + - v1: c'\u0022' + exp: 'decPost(v1)' + res: c'!' + + - v1: c'"' + exp: "c' ' + decPre(v1)" + res: c'A' + + - v1: c'\u0020' + exp: "c' ' + decPost(v1)" + res: c'?' + + - v1: c'\u0000' + exp: "decPre(v1)" + res: c'\uFFFF' + + - v1: c'\u0000' + exp: "decPost(v1)" + res: c'\uFFFF' + + - v1: c'\u00FF' + exp: "decPre(c'!' + v1 + v1)" + res: c'\u021E' + + - v1: c'\u0001' + exp: "decPost(v1 - c'!' - v1)" + res: c'\uFFDE' + + - v1: c'\u0F0F' + exp: "decPre(v1 - c'1') - decPre(c'\\uACD9')" + res: c'\u6205' + + - v1: c'\u0F0F' + exp: "decPost(v1 + c'1') + decPost(c'\\uACD9')" + res: c'\uBC17' + + - v1: c'\u1110' + exp: "decPre(c'\\u0000') - decPre(v1)" + res: c'\uEEF0' + + - v1: c'\u1000' + exp: "decPost(c'\\u0000') - decPost(v1)" + res: c'\uF000' + + - v1: c'∬' + exp: "decPre(v1)" + res: c'∫' + + - v1: c'∬' + exp: "decPost(v1)" + res: c'∫' diff --git a/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/increment/inc_arr_ref.ets b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/increment/inc_arr_ref.ets new file mode 100644 index 0000000000000000000000000000000000000000..2acd9331dab6c3614787d93f6cdc4416b711542c --- /dev/null +++ b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/increment/inc_arr_ref.ets @@ -0,0 +1,34 @@ +/*--- +Copyright (c) 2021-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. +---*/ +{%- for v in vals %} +/*--- +desc: >- + ArkTS provides a number of operators to act on character values: + Character operators that produce a value of type char. +---*/ + +const a: Char[] = new Char[2] + +function main() { + let v1 = new Char({{v.v1}}) + + a[0] = ++v1 + v1++ + a[1] = v1 + + assert a[0] == {{v.r1}} + assert a[1] == {{v.r2}} +} +{%- endfor %} diff --git a/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/increment/inc_arr_ref.params.yaml b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/increment/inc_arr_ref.params.yaml new file mode 100644 index 0000000000000000000000000000000000000000..99c330c86746d75153ab4a74c9d7e9097128a981 --- /dev/null +++ b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/increment/inc_arr_ref.params.yaml @@ -0,0 +1,37 @@ +# Copyright (c) 2021-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. +--- +vals: + - v1: c'\u0020' + r1: c'!' + r2: c'"' + + - v1: c'\x00' + r1: c'\x01' + r2: c'\x02' + + - v1: c'\uFFFF' + r1: c'\u0000' + r2: c'\u0001' + + - v1: c'\u007F' + r1: c'\u0080' + r2: c'\u0081; + + - v1: c'\u00FF' + r1: c'\u0100' + r2: c'\u0101; + + - v1: c'∫' + r1: c'∬' + r2: c'∭' diff --git a/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/increment/inc_arr_val.ets b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/increment/inc_arr_val.ets new file mode 100644 index 0000000000000000000000000000000000000000..0266760cfff87d9ec14efa55e4c5ec2a755c8c62 --- /dev/null +++ b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/increment/inc_arr_val.ets @@ -0,0 +1,34 @@ +/*--- +Copyright (c) 2021-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. +---*/ +{%- for v in vals %} +/*--- +desc: >- + ArkTS provides a number of operators to act on character values: + Character operators that produce a value of type char. +---*/ + +const a: char[] = new char[2] + +function main() { + let v1 = {{v.v1}} + + a[0] = ++v1 + v1++ + a[1] = v1 + + assert a[0] == {{v.r1}} + assert a[1] == {{v.r2}} +} +{%- endfor %} diff --git a/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/increment/inc_arr_val.params.yaml b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/increment/inc_arr_val.params.yaml new file mode 100644 index 0000000000000000000000000000000000000000..99c330c86746d75153ab4a74c9d7e9097128a981 --- /dev/null +++ b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/increment/inc_arr_val.params.yaml @@ -0,0 +1,37 @@ +# Copyright (c) 2021-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. +--- +vals: + - v1: c'\u0020' + r1: c'!' + r2: c'"' + + - v1: c'\x00' + r1: c'\x01' + r2: c'\x02' + + - v1: c'\uFFFF' + r1: c'\u0000' + r2: c'\u0001' + + - v1: c'\u007F' + r1: c'\u0080' + r2: c'\u0081; + + - v1: c'\u00FF' + r1: c'\u0100' + r2: c'\u0101; + + - v1: c'∫' + r1: c'∬' + r2: c'∭' diff --git a/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/increment/inc_func_ref.ets b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/increment/inc_func_ref.ets new file mode 100644 index 0000000000000000000000000000000000000000..471ba513144072c1ad610159981921e4cb09bc7b --- /dev/null +++ b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/increment/inc_func_ref.ets @@ -0,0 +1,36 @@ +/*--- +Copyright (c) 2021-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. +---*/ +{%- for v in vals %} +/*--- +desc: >- + ArkTS provides a number of operators to act on character values: + Character operators that produce a value of type char. +---*/ + +function incPre(p: Char): Char { + return ++p +} + +function incPost(p: Char): Char { + p++ + return p +} + +function main() { + const v1 = new Char({{v.v1}}) + + assert ({{v.exp}}) == {{v.res}} +} +{%- endfor %} diff --git a/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/increment/inc_func_ref.params.yaml b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/increment/inc_func_ref.params.yaml new file mode 100644 index 0000000000000000000000000000000000000000..d72c666673928b66f9664cdb55851209d076949d --- /dev/null +++ b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/increment/inc_func_ref.params.yaml @@ -0,0 +1,69 @@ +# Copyright (c) 2021-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. +--- +vals: + - v1: c'\u0020' + exp: 'incPre(v1)' + res: c'!' + + - v1: c'\u0020' + exp: 'incPost(v1)' + res: c'!' + + - v1: c'\u0020' + exp: "c' ' + incPre(v1)" + res: c'A' + + - v1: c'\u0020' + exp: "c' ' + incPost(v1)" + res: c'A' + + - v1: c'\uFFFF' + exp: "incPre(v1)" + res: c'\x00' + + - v1: c'\uFFFF' + exp: "incPost(v1)" + res: c'\x00' + + - v1: c'\uFFFF' + exp: "incPre(c'!' + v1 + v1)" + res: c'\u0020' + + - v1: c'\uFFFF' + exp: "incPost(c'!' + v1 + v1)" + res: c'\u0020' + + - v1: c'\u0F0F' + exp: "incPre(v1 + c'1') + incPre(c'\\uACD9')" + res: c'\uBC1B' + + - v1: c'\u0F0F' + exp: "incPost(v1 + c'1') + incPost(c'\\uACD9')" + res: c'\uBC1B' + + - v1: c'\u007F' + exp: "incPre(c'\\u0000') + incPre(v1)" + res: c'\u0081' + + - v1: c'\u007F' + exp: "incPost(c'\\u0000') + incPost(v1)" + res: c'\u0081' + + - v1: c'∫' + exp: "incPre(v1)" + res: c'∬' + + - v1: c'∫' + exp: "incPost(v1)" + res: c'∬' diff --git a/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/increment/inc_func_val.ets b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/increment/inc_func_val.ets new file mode 100644 index 0000000000000000000000000000000000000000..9c26217d293747f07165700ac1437a67ad5aa64e --- /dev/null +++ b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/increment/inc_func_val.ets @@ -0,0 +1,36 @@ +/*--- +Copyright (c) 2021-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. +---*/ +{%- for v in vals %} +/*--- +desc: >- + ArkTS provides a number of operators to act on character values: + Character operators that produce a value of type char. +---*/ + +function incPre(p: char): char { + return ++p +} + +function incPost(p: char): char { + p++ + return p +} + +function main() { + const v1 = {{v.v1}} + + assert ({{v.exp}}) == {{v.res}} +} +{%- endfor %} diff --git a/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/increment/inc_func_val.params.yaml b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/increment/inc_func_val.params.yaml new file mode 100644 index 0000000000000000000000000000000000000000..d72c666673928b66f9664cdb55851209d076949d --- /dev/null +++ b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/increment/inc_func_val.params.yaml @@ -0,0 +1,69 @@ +# Copyright (c) 2021-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. +--- +vals: + - v1: c'\u0020' + exp: 'incPre(v1)' + res: c'!' + + - v1: c'\u0020' + exp: 'incPost(v1)' + res: c'!' + + - v1: c'\u0020' + exp: "c' ' + incPre(v1)" + res: c'A' + + - v1: c'\u0020' + exp: "c' ' + incPost(v1)" + res: c'A' + + - v1: c'\uFFFF' + exp: "incPre(v1)" + res: c'\x00' + + - v1: c'\uFFFF' + exp: "incPost(v1)" + res: c'\x00' + + - v1: c'\uFFFF' + exp: "incPre(c'!' + v1 + v1)" + res: c'\u0020' + + - v1: c'\uFFFF' + exp: "incPost(c'!' + v1 + v1)" + res: c'\u0020' + + - v1: c'\u0F0F' + exp: "incPre(v1 + c'1') + incPre(c'\\uACD9')" + res: c'\uBC1B' + + - v1: c'\u0F0F' + exp: "incPost(v1 + c'1') + incPost(c'\\uACD9')" + res: c'\uBC1B' + + - v1: c'\u007F' + exp: "incPre(c'\\u0000') + incPre(v1)" + res: c'\u0081' + + - v1: c'\u007F' + exp: "incPost(c'\\u0000') + incPost(v1)" + res: c'\u0081' + + - v1: c'∫' + exp: "incPre(v1)" + res: c'∬' + + - v1: c'∫' + exp: "incPost(v1)" + res: c'∬' diff --git a/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/subtraction/sub_arr_ref.ets b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/subtraction/sub_arr_ref.ets new file mode 100644 index 0000000000000000000000000000000000000000..f3b8a0845a3c788d65bb5e8b97aea6704f85293f --- /dev/null +++ b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/subtraction/sub_arr_ref.ets @@ -0,0 +1,31 @@ +/*--- +Copyright (c) 2021-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. +---*/ +{%- for v in vals %} +/*--- +desc: >- + ArkTS provides a number of operators to act on character values: + Character operators that produce a value of type char. +---*/ + +const a: Char[] = new Char[1] + +function main() { + const v1 = new Char({{v.v1}}) + const v2 = new Char({{v.v2}}) + + a[0] = {{v.exp}} + assert a[0] == {{v.r}} +} +{%- endfor %} diff --git a/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/subtraction/sub_arr_ref.params.yaml b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/subtraction/sub_arr_ref.params.yaml new file mode 100644 index 0000000000000000000000000000000000000000..6521acad47d60eb4d2cbec655d99c639cb6d1fa1 --- /dev/null +++ b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/subtraction/sub_arr_ref.params.yaml @@ -0,0 +1,48 @@ +# Copyright (c) 2021-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. +--- +vals: + - v1: c'\u0020' + v2: c'\u0041' + exp: 'v2 - v1' + r: c'!' + + - v1: c'\u0041' + v2: c'\u0001' + exp: "v1 - v2 - c' '" + r: c' ' + + - v1: c'\uFFFF' + v2: c'\uFFFF' + exp: 'v1 - v2' + r: c'\u0000' + + - v1: c'\uFFFF' + v2: c'\u0000' + exp: 'v2 - v1' + r: c'\u0001' + + - v1: c'\uFFFF' + v2: c'\u000F' + exp: "c'\\u000F' - v1" + r: c'\u0010' + + - v1: c'\u1010' + v2: c'\u0101' + exp: "v1 - c'\\u0101' - v2 - c'\\u1010'" + r: c'\uFDFE' + + - v1: c'∬' + v2: c'\x01' + exp: 'v1 - v2' + r: c'∫' diff --git a/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/subtraction/sub_arr_val.ets b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/subtraction/sub_arr_val.ets new file mode 100644 index 0000000000000000000000000000000000000000..889f670f9160b83a62706cc2f6372898a6b3d3b8 --- /dev/null +++ b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/subtraction/sub_arr_val.ets @@ -0,0 +1,31 @@ +/*--- +Copyright (c) 2021-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. +---*/ +{%- for v in vals %} +/*--- +desc: >- + ArkTS provides a number of operators to act on character values: + Character operators that produce a value of type char. +---*/ + +const a: char[] = new char[1] + +function main() { + const v1 = {{v.v1}} + const v2 = {{v.v2}} + + a[0] = {{v.exp}} + assert a[0] == {{v.r}} +} +{%- endfor %} diff --git a/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/subtraction/sub_arr_val.params.yaml b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/subtraction/sub_arr_val.params.yaml new file mode 100644 index 0000000000000000000000000000000000000000..6521acad47d60eb4d2cbec655d99c639cb6d1fa1 --- /dev/null +++ b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/subtraction/sub_arr_val.params.yaml @@ -0,0 +1,48 @@ +# Copyright (c) 2021-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. +--- +vals: + - v1: c'\u0020' + v2: c'\u0041' + exp: 'v2 - v1' + r: c'!' + + - v1: c'\u0041' + v2: c'\u0001' + exp: "v1 - v2 - c' '" + r: c' ' + + - v1: c'\uFFFF' + v2: c'\uFFFF' + exp: 'v1 - v2' + r: c'\u0000' + + - v1: c'\uFFFF' + v2: c'\u0000' + exp: 'v2 - v1' + r: c'\u0001' + + - v1: c'\uFFFF' + v2: c'\u000F' + exp: "c'\\u000F' - v1" + r: c'\u0010' + + - v1: c'\u1010' + v2: c'\u0101' + exp: "v1 - c'\\u0101' - v2 - c'\\u1010'" + r: c'\uFDFE' + + - v1: c'∬' + v2: c'\x01' + exp: 'v1 - v2' + r: c'∫' diff --git a/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/subtraction/sub_func_ref.ets b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/subtraction/sub_func_ref.ets new file mode 100644 index 0000000000000000000000000000000000000000..c12a5ad80fc5ebd8b202319ba16e120fb706004b --- /dev/null +++ b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/subtraction/sub_func_ref.ets @@ -0,0 +1,32 @@ +/*--- +Copyright (c) 2021-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. +---*/ +{%- for v in vals %} +/*--- +desc: >- + ArkTS provides a number of operators to act on character values: + Character operators that produce a value of type char. +---*/ + +function sub(p: Char, q: Char): Char { + return p - q +} + +function main() { + const v1 = new Char({{v.v1}}) + const v2 = new Char({{v.v2}}) + + assert ({{v.exp}}) == {{v.r}} +} +{%- endfor %} diff --git a/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/subtraction/sub_func_ref.params.yaml b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/subtraction/sub_func_ref.params.yaml new file mode 100644 index 0000000000000000000000000000000000000000..38c8a3a2b2c24c0d9dd3522d486bd8004466f62f --- /dev/null +++ b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/subtraction/sub_func_ref.params.yaml @@ -0,0 +1,48 @@ +# Copyright (c) 2021-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. +--- +vals: + - v1: c'\u0020' + v2: c'\u0041' + exp: 'sub(v2, v1)' + r: c'!' + + - v1: c'\u0041' + v2: c'\u0001' + exp: "sub(v1, v2) - c' '" + r: c' ' + + - v1: c'\uFFFF' + v2: c'\uFFFF' + exp: 'sub(v1, v2)' + r: c'\u0000' + + - v1: c'\uFFFF' + v2: c'\u0000' + exp: 'sub(v2, v1)' + r: c'\u0001' + + - v1: c'\uFFFF' + v2: c'\u000F' + exp: "sub(c'\\u000F', v1)" + r: c'\u0010' + + - v1: c'\u1010' + v2: c'\u0101' + exp: "sub(v1 - c'\\u0101', v2 - c'\\u1010')" + r: c'\u1E1E' + + - v1: c'∬' + v2: c'\x01' + exp: 'sub(v1, v2)' + r: c'∫' diff --git a/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/subtraction/sub_func_val.ets b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/subtraction/sub_func_val.ets new file mode 100644 index 0000000000000000000000000000000000000000..ad928ef5bda3ce8820edec728453753f20f916b2 --- /dev/null +++ b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/subtraction/sub_func_val.ets @@ -0,0 +1,32 @@ +/*--- +Copyright (c) 2021-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. +---*/ +{%- for v in vals %} +/*--- +desc: >- + ArkTS provides a number of operators to act on character values: + Character operators that produce a value of type char. +---*/ + +function sub(p: char, q: char): char { + return p - q +} + +function main() { + const v1 = {{v.v1}} + const v2 = {{v.v2}} + + assert ({{v.exp}}) == {{v.r}} +} +{%- endfor %} diff --git a/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/subtraction/sub_func_val.params.yaml b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/subtraction/sub_func_val.params.yaml new file mode 100644 index 0000000000000000000000000000000000000000..38c8a3a2b2c24c0d9dd3522d486bd8004466f62f --- /dev/null +++ b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/subtraction/sub_func_val.params.yaml @@ -0,0 +1,48 @@ +# Copyright (c) 2021-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. +--- +vals: + - v1: c'\u0020' + v2: c'\u0041' + exp: 'sub(v2, v1)' + r: c'!' + + - v1: c'\u0041' + v2: c'\u0001' + exp: "sub(v1, v2) - c' '" + r: c' ' + + - v1: c'\uFFFF' + v2: c'\uFFFF' + exp: 'sub(v1, v2)' + r: c'\u0000' + + - v1: c'\uFFFF' + v2: c'\u0000' + exp: 'sub(v2, v1)' + r: c'\u0001' + + - v1: c'\uFFFF' + v2: c'\u000F' + exp: "sub(c'\\u000F', v1)" + r: c'\u0010' + + - v1: c'\u1010' + v2: c'\u0101' + exp: "sub(v1 - c'\\u0101', v2 - c'\\u1010')" + r: c'\u1E1E' + + - v1: c'∬' + v2: c'\x01' + exp: 'sub(v1, v2)' + r: c'∫' diff --git a/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/unary/unary_ref.ets b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/unary/unary_ref.ets new file mode 100644 index 0000000000000000000000000000000000000000..5fc15f990b30ab1040359faaee597b8b5c363741 --- /dev/null +++ b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/unary/unary_ref.ets @@ -0,0 +1,35 @@ +/*--- +Copyright (c) 2021-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. +---*/ +{%- for v in vals %} +/*--- +desc: >- + ArkTS provides a number of operators to act on character values: + Character operators that produce a value of type char. +---*/ + +function minus(p: Char): Char { + return -p +} + +function plus(p: Char): Char { + return +p +} + +function main() { + const v1 = new Char({{v.v1}}) + + assert ({{v.exp}}) == {{v.r}} +} +{%- endfor %} diff --git a/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/unary/unary_ref.params.yaml b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/unary/unary_ref.params.yaml new file mode 100644 index 0000000000000000000000000000000000000000..c4baf0ac2bc358f4094af8c7f7a503be870175da --- /dev/null +++ b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/unary/unary_ref.params.yaml @@ -0,0 +1,41 @@ +# Copyright (c) 2021-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. +--- +vals: + - v1: c'\u0020' + exp: 'minus(plus(v1)) - plus(minus(v1))' + r: c'\u0000' + + - v1: c'∬' + exp: 'plus(v1)' + r: c'∬' + + - v1: c'∬' + exp: 'minus(v1)' + r: c'\uDDD4' + + - v1: c'\uFFFF' + exp: 'minus(v1)' + r: c'\u0001' + + - v1: c'\uFFFF' + exp: 'plus(v1)' + r: c'\uFFFF' + + - v1: c'\u0000' + exp: 'minus(v1)' + r: c'\u0000' + + - v1: c'\u0000' + exp: 'plus(v1)' + r: c'\u0000' diff --git a/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/unary/unary_val.ets b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/unary/unary_val.ets new file mode 100644 index 0000000000000000000000000000000000000000..d4f9b8ea3f82293bf0cc45a186d7e3af206eb234 --- /dev/null +++ b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/unary/unary_val.ets @@ -0,0 +1,35 @@ +/*--- +Copyright (c) 2021-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. +---*/ +{%- for v in vals %} +/*--- +desc: >- + ArkTS provides a number of operators to act on character values: + Character operators that produce a value of type char. +---*/ + +function minus(p: char): char { + return -p +} + +function plus(p: char): char { + return +p +} + +function main() { + const v1 = {{v.v1}} + + assert ({{v.exp}}) == {{v.r}} +} +{%- endfor %} diff --git a/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/unary/unary_val.params.yaml b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/unary/unary_val.params.yaml new file mode 100644 index 0000000000000000000000000000000000000000..c4baf0ac2bc358f4094af8c7f7a503be870175da --- /dev/null +++ b/plugins/ets/tests/ets-templates/03.types/07.value_types/05.character_types_and_operations/unary/unary_val.params.yaml @@ -0,0 +1,41 @@ +# Copyright (c) 2021-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. +--- +vals: + - v1: c'\u0020' + exp: 'minus(plus(v1)) - plus(minus(v1))' + r: c'\u0000' + + - v1: c'∬' + exp: 'plus(v1)' + r: c'∬' + + - v1: c'∬' + exp: 'minus(v1)' + r: c'\uDDD4' + + - v1: c'\uFFFF' + exp: 'minus(v1)' + r: c'\u0001' + + - v1: c'\uFFFF' + exp: 'plus(v1)' + r: c'\uFFFF' + + - v1: c'\u0000' + exp: 'minus(v1)' + r: c'\u0000' + + - v1: c'\u0000' + exp: 'plus(v1)' + r: c'\u0000' diff --git a/plugins/ets/tests/ets-templates/07.expressions/29.conditional_expressions/first_expression_not_boolean.ets b/plugins/ets/tests/ets-templates/07.expressions/29.conditional_expressions/first_expression_not_boolean.ets index b3b2d1d2e793c16820540b2b09ecb6856be46a62..d82beda368d83e8cb559562b490ae2d53e89aedb 100644 --- a/plugins/ets/tests/ets-templates/07.expressions/29.conditional_expressions/first_expression_not_boolean.ets +++ b/plugins/ets/tests/ets-templates/07.expressions/29.conditional_expressions/first_expression_not_boolean.ets @@ -21,5 +21,6 @@ tags: [compile-only, negative] function cond(): void {} function main(): void { - let a = cond() ? 0 : 1; + let a = cond() ? 1 : 0; + return a; } diff --git a/plugins/ets/tests/ets-templates/08.statements/05.if_statements/if2.params.yaml b/plugins/ets/tests/ets-templates/08.statements/05.if_statements/if2.params.yaml index cc402a6c398d53c379af80e97d3f100d2f9079f6..386cf7b198d4c6c583aebb84a7e853de7ce48027 100644 --- a/plugins/ets/tests/ets-templates/08.statements/05.if_statements/if2.params.yaml +++ b/plugins/ets/tests/ets-templates/08.statements/05.if_statements/if2.params.yaml @@ -133,3 +133,33 @@ cases: else return retcode("FF") } + + - use: |- + if (i) return 0; + else return j; + + - use: |- + if (new Object()) return 0; + else return j; + + - use: |- + if ("xyz") return 0; + else return j; + + - use: |- + if (!"") return 0; + else return j; + + - use: |- + if (!null) return 0; + else return j; + + - use: |- + if ([1, 1]) return 0; + else return j; + + - use: |- + let k: int[] = []; + if (!k) return 0; + else return j; + diff --git a/plugins/ets/tests/ets-templates/08.statements/05.if_statements/if_neg.params.yaml b/plugins/ets/tests/ets-templates/08.statements/05.if_statements/if_neg.params.yaml index b19ec808e5db37c304b1d2b8a5bf7e4efa2fec18..7ee89237506e3a2f8ad502879b4f77e2a0c0ef17 100644 --- a/plugins/ets/tests/ets-templates/08.statements/05.if_statements/if_neg.params.yaml +++ b/plugins/ets/tests/ets-templates/08.statements/05.if_statements/if_neg.params.yaml @@ -13,22 +13,6 @@ --- cases: - - use: |- - // wrong type - if (i) return 1; - - - use: |- - // wrong type - if (new Object()) return 1; - - - use: |- - // wrong type - if ("xyz") return 1; - - - use: |- - // wrong type - if (!null) return 1; - - use: |- // missing statement in then branch if (i == j) diff --git a/plugins/ets/tests/ets-templates/08.statements/07.while_statements_and_do_statements/do.params.yaml b/plugins/ets/tests/ets-templates/08.statements/07.while_statements_and_do_statements/do.params.yaml index 864e870b0adedc5c6f1a5749acb1ccbb22785a42..f92b779942eb4901b1818cdd698144172af20095 100644 --- a/plugins/ets/tests/ets-templates/08.statements/07.while_statements_and_do_statements/do.params.yaml +++ b/plugins/ets/tests/ets-templates/08.statements/07.while_statements_and_do_statements/do.params.yaml @@ -41,3 +41,11 @@ cases: i = j; } while (j < 3) if (i == 1 && j == 4) return 0; + + - use: |- + do {i--} while (i+j) + if (i == -1) return 0; + + - use: |- + do {i--} while (i & j) + if (i == 0) return 0; diff --git a/plugins/ets/tests/ets-templates/08.statements/07.while_statements_and_do_statements/neg.params.yaml b/plugins/ets/tests/ets-templates/08.statements/07.while_statements_and_do_statements/neg.params.yaml index d24cf73a4d48ebd555b781f612cb213866643e9e..be3dd17a4db03a97a1b778bf1136c5c70b5ca859 100644 --- a/plugins/ets/tests/ets-templates/08.statements/07.while_statements_and_do_statements/neg.params.yaml +++ b/plugins/ets/tests/ets-templates/08.statements/07.while_statements_and_do_statements/neg.params.yaml @@ -13,22 +13,6 @@ --- cases: - - use: |- - // wrong type - while (1) {} - - - use: |- - // wrong type - do {} while (1) - - - use: |- - // wrong type - while (i & j) {} - - - use: |- - // wrong type - do {} while (i & j) - - use: |- // missing parentheses while i > j {} diff --git a/plugins/ets/tests/ets-templates/08.statements/07.while_statements_and_do_statements/while.params.yaml b/plugins/ets/tests/ets-templates/08.statements/07.while_statements_and_do_statements/while.params.yaml index 923f33217a44ed90be6ebb99236bae68bcf9b47e..1f1f81ec2bbd7a7f0bc77d0178c8b4e1eb080fe6 100644 --- a/plugins/ets/tests/ets-templates/08.statements/07.while_statements_and_do_statements/while.params.yaml +++ b/plugins/ets/tests/ets-templates/08.statements/07.while_statements_and_do_statements/while.params.yaml @@ -37,3 +37,11 @@ cases: - use: |- while(++i < 10); { i-- } if (i == 9) return 0; + + - use: |- + while (i+j) { i-- } + if (i == -1) return 0; + + - use: |- + while (i & j) {i--} + if (i == 0) return 0; diff --git a/plugins/ets/tests/scripts/CtsTools/skiplists/arktscts-int-amd64-FastVerify.txt b/plugins/ets/tests/scripts/CtsTools/skiplists/arktscts-int-amd64-FastVerify.txt index 56dc431dc10ee91ec0ab7ea8bf6a1b574434c9a6..6f0e4e65819e5e7f2076009d8c2edb3adfe15a42 100644 --- a/plugins/ets/tests/scripts/CtsTools/skiplists/arktscts-int-amd64-FastVerify.txt +++ b/plugins/ets/tests/scripts/CtsTools/skiplists/arktscts-int-amd64-FastVerify.txt @@ -846,28 +846,6 @@ 03.types/04.value_types/01.integer_types_and_operations/subtraction/subtraction_ushort_7 # Not implemented 03.types/04.value_types/01.integer_types_and_operations/subtraction/subtraction_ushort_8 # Not implemented 03.types/04.value_types/01.integer_types_and_operations/subtraction/subtraction_ushort_9 # Not implemented -03.types/04.value_types/01.integer_types_and_operations/ternary/ternary_byte_0 # TypeError: Condition must be of type boolean -03.types/04.value_types/01.integer_types_and_operations/ternary/ternary_byte_1 # TypeError: Condition must be of type boolean -03.types/04.value_types/01.integer_types_and_operations/ternary/ternary_byte_2 # TypeError: Condition must be of type boolean -03.types/04.value_types/01.integer_types_and_operations/ternary/ternary_char_0 # TypeError: Condition must be of type boolean -03.types/04.value_types/01.integer_types_and_operations/ternary/ternary_char_1 # TypeError: Condition must be of type boolean -03.types/04.value_types/01.integer_types_and_operations/ternary/ternary_int_0 # TypeError: Condition must be of type boolean -03.types/04.value_types/01.integer_types_and_operations/ternary/ternary_int_1 # TypeError: Condition must be of type boolean -03.types/04.value_types/01.integer_types_and_operations/ternary/ternary_int_2 # TypeError: Condition must be of type boolean -03.types/04.value_types/01.integer_types_and_operations/ternary/ternary_long_0 # TypeError: Condition must be of type boolean -03.types/04.value_types/01.integer_types_and_operations/ternary/ternary_long_1 # TypeError: Condition must be of type boolean -03.types/04.value_types/01.integer_types_and_operations/ternary/ternary_long_2 # TypeError: Condition must be of type boolean -03.types/04.value_types/01.integer_types_and_operations/ternary/ternary_short_0 # TypeError: Condition must be of type boolean -03.types/04.value_types/01.integer_types_and_operations/ternary/ternary_short_1 # TypeError: Condition must be of type boolean -03.types/04.value_types/01.integer_types_and_operations/ternary/ternary_short_2 # TypeError: Condition must be of type boolean -03.types/04.value_types/01.integer_types_and_operations/ternary/ternary_ubyte_0 # TypeError: Condition must be of type boolean -03.types/04.value_types/01.integer_types_and_operations/ternary/ternary_ubyte_1 # TypeError: Condition must be of type boolean -03.types/04.value_types/01.integer_types_and_operations/ternary/ternary_uint_0 # TypeError: Condition must be of type boolean -03.types/04.value_types/01.integer_types_and_operations/ternary/ternary_uint_1 # TypeError: Condition must be of type boolean -03.types/04.value_types/01.integer_types_and_operations/ternary/ternary_ulong_0 # TypeError: Condition must be of type boolean -03.types/04.value_types/01.integer_types_and_operations/ternary/ternary_ulong_1 # TypeError: Condition must be of type boolean -03.types/04.value_types/01.integer_types_and_operations/ternary/ternary_ushort_0 # TypeError: Condition must be of type boolean -03.types/04.value_types/01.integer_types_and_operations/ternary/ternary_ushort_1 # TypeError: Condition must be of type boolean 03.types/04.value_types/01.integer_types_and_operations/unary_minus/unary_minus_char_2 # TypeError: Method MAX_VALUE does not exist on this type. 03.types/04.value_types/01.integer_types_and_operations/unary_minus/unary_minus_char_3 # TypeError: Method MIN_VALUE does not exist on this type. 03.types/04.value_types/01.integer_types_and_operations/unary_minus/unary_minus_ubyte_0 # Not implemented diff --git a/tests/tests-u-runner/runner/plugins/ets/ets-cts-ignored.txt b/tests/tests-u-runner/runner/plugins/ets/ets-cts-ignored.txt index 63e4c0c49232734230940012901102777cc5a7f5..f31d42afdb9beb12278bf547a1fc89127c52f664 100644 --- a/tests/tests-u-runner/runner/plugins/ets/ets-cts-ignored.txt +++ b/tests/tests-u-runner/runner/plugins/ets/ets-cts-ignored.txt @@ -451,14 +451,6 @@ 07.expressions/01.evaluation_of_expressions/02.normal_and_abrupt_completion_of_expression_evaluation/ase1.ets # end of verifier problems # runtime fails: panda#11542 -03.types/07.value_types/01.integer_types_and_operations/postfix_decrement/postfix_decrement_byte_3.ets -03.types/07.value_types/01.integer_types_and_operations/postfix_decrement/postfix_decrement_short_3.ets -03.types/07.value_types/01.integer_types_and_operations/postfix_increment/postfix_increment_byte_4.ets -03.types/07.value_types/01.integer_types_and_operations/postfix_increment/postfix_increment_short_4.ets -03.types/07.value_types/01.integer_types_and_operations/prefix_decrement/prefix_decrement_byte_3.ets -03.types/07.value_types/01.integer_types_and_operations/prefix_decrement/prefix_decrement_short_3.ets -03.types/07.value_types/01.integer_types_and_operations/prefix_increment/prefix_increment_byte_4.ets -03.types/07.value_types/01.integer_types_and_operations/prefix_increment/prefix_increment_short_4.ets 03.types/07.value_types/01.integer_types_and_operations/right_shift/right_shift_long_10.ets 03.types/07.value_types/01.integer_types_and_operations/unsigned_right_shift/unsigned_right_shift_byte_7.ets 03.types/07.value_types/01.integer_types_and_operations/unsigned_right_shift/unsigned_right_shift_short_7.ets @@ -986,7 +978,6 @@ 03.types/07.value_types/01.integer_types_and_operations/not_equal/not_equal_ushort_7.ets 03.types/07.value_types/01.integer_types_and_operations/not_equal/not_equal_ushort_8.ets 03.types/07.value_types/01.integer_types_and_operations/not_equal/not_equal_ushort_9.ets -03.types/07.value_types/01.integer_types_and_operations/postfix_decrement/postfix_decrement_char_2.ets 03.types/07.value_types/01.integer_types_and_operations/postfix_decrement/postfix_decrement_ubyte_0.ets 03.types/07.value_types/01.integer_types_and_operations/postfix_decrement/postfix_decrement_ubyte_1.ets 03.types/07.value_types/01.integer_types_and_operations/postfix_decrement/postfix_decrement_ubyte_2.ets @@ -1008,7 +999,6 @@ 03.types/07.value_types/01.integer_types_and_operations/postfix_decrement/postfix_decrement_ushort_2.ets 03.types/07.value_types/01.integer_types_and_operations/postfix_decrement/postfix_decrement_ushort_3.ets 03.types/07.value_types/01.integer_types_and_operations/postfix_decrement/postfix_decrement_ushort_4.ets -03.types/07.value_types/01.integer_types_and_operations/postfix_increment/postfix_increment_char_3.ets 03.types/07.value_types/01.integer_types_and_operations/postfix_increment/postfix_increment_ubyte_0.ets 03.types/07.value_types/01.integer_types_and_operations/postfix_increment/postfix_increment_ubyte_1.ets 03.types/07.value_types/01.integer_types_and_operations/postfix_increment/postfix_increment_ubyte_2.ets @@ -1029,7 +1019,6 @@ 03.types/07.value_types/01.integer_types_and_operations/postfix_increment/postfix_increment_ushort_2.ets 03.types/07.value_types/01.integer_types_and_operations/postfix_increment/postfix_increment_ushort_3.ets 03.types/07.value_types/01.integer_types_and_operations/postfix_increment/postfix_increment_ushort_4.ets -03.types/07.value_types/01.integer_types_and_operations/prefix_decrement/prefix_decrement_char_2.ets 03.types/07.value_types/01.integer_types_and_operations/prefix_decrement/prefix_decrement_ubyte_0.ets 03.types/07.value_types/01.integer_types_and_operations/prefix_decrement/prefix_decrement_ubyte_1.ets 03.types/07.value_types/01.integer_types_and_operations/prefix_decrement/prefix_decrement_ubyte_2.ets @@ -1050,7 +1039,6 @@ 03.types/07.value_types/01.integer_types_and_operations/prefix_decrement/prefix_decrement_ushort_2.ets 03.types/07.value_types/01.integer_types_and_operations/prefix_decrement/prefix_decrement_ushort_3.ets 03.types/07.value_types/01.integer_types_and_operations/prefix_decrement/prefix_decrement_ushort_4.ets -03.types/07.value_types/01.integer_types_and_operations/prefix_increment/prefix_increment_char_3.ets 03.types/07.value_types/01.integer_types_and_operations/prefix_increment/prefix_increment_ubyte_0.ets 03.types/07.value_types/01.integer_types_and_operations/prefix_increment/prefix_increment_ubyte_1.ets 03.types/07.value_types/01.integer_types_and_operations/prefix_increment/prefix_increment_ubyte_2.ets @@ -1921,6 +1909,123 @@ 05.generics/05.parameterized_declarations/type_arguments_of_parameterized_declarations/method_args1_13.ets # end of verifier fails +# es2panda fails: panda#14140 +03.types/07.value_types/05.character_types_and_operations/ch_n_0.ets +03.types/07.value_types/05.character_types_and_operations/ch_n_1.ets +03.types/07.value_types/05.character_types_and_operations/ch_n_10.ets +03.types/07.value_types/05.character_types_and_operations/ch_n_2.ets +03.types/07.value_types/05.character_types_and_operations/ch_n_3.ets +03.types/07.value_types/05.character_types_and_operations/ch_n_4.ets +03.types/07.value_types/05.character_types_and_operations/ch_n_5.ets +03.types/07.value_types/05.character_types_and_operations/ch_n_6.ets +03.types/07.value_types/05.character_types_and_operations/ch_n_8.ets +# end of es2panda fails + +# es2panda fails: panda#14110 +03.types/07.value_types/05.character_types_and_operations/decrement/dec_func_ref_6.ets +03.types/07.value_types/05.character_types_and_operations/decrement/dec_func_ref_7.ets +03.types/07.value_types/05.character_types_and_operations/decrement/dec_func_ref_8.ets +03.types/07.value_types/05.character_types_and_operations/decrement/dec_func_ref_9.ets +03.types/07.value_types/05.character_types_and_operations/decrement/dec_func_val_6.ets +03.types/07.value_types/05.character_types_and_operations/decrement/dec_func_val_7.ets +03.types/07.value_types/05.character_types_and_operations/decrement/dec_func_val_8.ets +03.types/07.value_types/05.character_types_and_operations/decrement/dec_func_val_9.ets +03.types/07.value_types/05.character_types_and_operations/increment/inc_arr_ref_3.ets +03.types/07.value_types/05.character_types_and_operations/increment/inc_arr_ref_4.ets +03.types/07.value_types/05.character_types_and_operations/increment/inc_arr_val_3.ets +03.types/07.value_types/05.character_types_and_operations/increment/inc_arr_val_4.ets +03.types/07.value_types/05.character_types_and_operations/increment/inc_func_ref_6.ets +03.types/07.value_types/05.character_types_and_operations/increment/inc_func_ref_7.ets +03.types/07.value_types/05.character_types_and_operations/increment/inc_func_ref_8.ets +03.types/07.value_types/05.character_types_and_operations/increment/inc_func_ref_9.ets +03.types/07.value_types/05.character_types_and_operations/increment/inc_func_val_6.ets +03.types/07.value_types/05.character_types_and_operations/increment/inc_func_val_7.ets +03.types/07.value_types/05.character_types_and_operations/increment/inc_func_val_8.ets +03.types/07.value_types/05.character_types_and_operations/increment/inc_func_val_9.ets +# end of es2panda fails + +# es2panda fails: panda#14105 +03.types/07.value_types/05.character_types_and_operations/addition/add_arr_ref_0.ets +03.types/07.value_types/05.character_types_and_operations/addition/add_arr_ref_1.ets +03.types/07.value_types/05.character_types_and_operations/addition/add_arr_ref_2.ets +03.types/07.value_types/05.character_types_and_operations/addition/add_arr_ref_3.ets +03.types/07.value_types/05.character_types_and_operations/addition/add_arr_ref_4.ets +03.types/07.value_types/05.character_types_and_operations/addition/add_arr_ref_5.ets +03.types/07.value_types/05.character_types_and_operations/addition/add_arr_ref_6.ets +03.types/07.value_types/05.character_types_and_operations/addition/add_arr_val_2.ets +03.types/07.value_types/05.character_types_and_operations/addition/add_arr_val_3.ets +03.types/07.value_types/05.character_types_and_operations/addition/add_arr_val_4.ets +03.types/07.value_types/05.character_types_and_operations/addition/add_func_ref_0.ets +03.types/07.value_types/05.character_types_and_operations/addition/add_func_ref_1.ets +03.types/07.value_types/05.character_types_and_operations/addition/add_func_ref_2.ets +03.types/07.value_types/05.character_types_and_operations/addition/add_func_ref_3.ets +03.types/07.value_types/05.character_types_and_operations/addition/add_func_ref_4.ets +03.types/07.value_types/05.character_types_and_operations/addition/add_func_ref_5.ets +03.types/07.value_types/05.character_types_and_operations/addition/add_func_ref_6.ets +03.types/07.value_types/05.character_types_and_operations/addition/add_func_val_0.ets +03.types/07.value_types/05.character_types_and_operations/addition/add_func_val_1.ets +03.types/07.value_types/05.character_types_and_operations/addition/add_func_val_2.ets +03.types/07.value_types/05.character_types_and_operations/addition/add_func_val_3.ets +03.types/07.value_types/05.character_types_and_operations/addition/add_func_val_4.ets +03.types/07.value_types/05.character_types_and_operations/addition/add_func_val_5.ets +03.types/07.value_types/05.character_types_and_operations/addition/add_func_val_6.ets +03.types/07.value_types/05.character_types_and_operations/subtraction/sub_arr_ref_0.ets +03.types/07.value_types/05.character_types_and_operations/subtraction/sub_arr_ref_1.ets +03.types/07.value_types/05.character_types_and_operations/subtraction/sub_arr_ref_2.ets +03.types/07.value_types/05.character_types_and_operations/subtraction/sub_arr_ref_3.ets +03.types/07.value_types/05.character_types_and_operations/subtraction/sub_arr_ref_4.ets +03.types/07.value_types/05.character_types_and_operations/subtraction/sub_arr_ref_5.ets +03.types/07.value_types/05.character_types_and_operations/subtraction/sub_arr_ref_6.ets +03.types/07.value_types/05.character_types_and_operations/subtraction/sub_arr_val_3.ets +03.types/07.value_types/05.character_types_and_operations/subtraction/sub_arr_val_4.ets +03.types/07.value_types/05.character_types_and_operations/subtraction/sub_arr_val_5.ets +03.types/07.value_types/05.character_types_and_operations/subtraction/sub_func_ref_0.ets +03.types/07.value_types/05.character_types_and_operations/subtraction/sub_func_ref_1.ets +03.types/07.value_types/05.character_types_and_operations/subtraction/sub_func_ref_2.ets +03.types/07.value_types/05.character_types_and_operations/subtraction/sub_func_ref_3.ets +03.types/07.value_types/05.character_types_and_operations/subtraction/sub_func_ref_4.ets +03.types/07.value_types/05.character_types_and_operations/subtraction/sub_func_ref_5.ets +03.types/07.value_types/05.character_types_and_operations/subtraction/sub_func_ref_6.ets +03.types/07.value_types/05.character_types_and_operations/subtraction/sub_func_val_0.ets +03.types/07.value_types/05.character_types_and_operations/subtraction/sub_func_val_1.ets +03.types/07.value_types/05.character_types_and_operations/subtraction/sub_func_val_2.ets +03.types/07.value_types/05.character_types_and_operations/subtraction/sub_func_val_3.ets +03.types/07.value_types/05.character_types_and_operations/subtraction/sub_func_val_4.ets +03.types/07.value_types/05.character_types_and_operations/subtraction/sub_func_val_5.ets +03.types/07.value_types/05.character_types_and_operations/subtraction/sub_func_val_6.ets +03.types/07.value_types/05.character_types_and_operations/concat/conc_ref_0.ets +03.types/07.value_types/05.character_types_and_operations/concat/conc_ref_1.ets +03.types/07.value_types/05.character_types_and_operations/concat/conc_ref_2.ets +03.types/07.value_types/05.character_types_and_operations/concat/conc_ref_3.ets +03.types/07.value_types/05.character_types_and_operations/concat/conc_ref_4.ets +03.types/07.value_types/05.character_types_and_operations/concat/conc_val_0.ets +03.types/07.value_types/05.character_types_and_operations/concat/conc_val_1.ets +03.types/07.value_types/05.character_types_and_operations/concat/conc_val_2.ets +03.types/07.value_types/05.character_types_and_operations/concat/conc_val_3.ets +03.types/07.value_types/05.character_types_and_operations/concat/conc_val_4.ets +03.types/07.value_types/05.character_types_and_operations/conditional/cond_exp_val_2.ets +03.types/07.value_types/05.character_types_and_operations/conditional/cond_fld_val_2.ets +03.types/07.value_types/05.character_types_and_operations/conditional/cond_func_ref_4.ets +03.types/07.value_types/05.character_types_and_operations/conditional/cond_func_val_1.ets +03.types/07.value_types/05.character_types_and_operations/conditional/cond_func_val_2.ets +03.types/07.value_types/05.character_types_and_operations/conditional/cond_func_val_4.ets +03.types/07.value_types/05.character_types_and_operations/unary/unary_ref_0.ets +03.types/07.value_types/05.character_types_and_operations/unary/unary_ref_1.ets +03.types/07.value_types/05.character_types_and_operations/unary/unary_ref_2.ets +03.types/07.value_types/05.character_types_and_operations/unary/unary_ref_3.ets +03.types/07.value_types/05.character_types_and_operations/unary/unary_ref_4.ets +03.types/07.value_types/05.character_types_and_operations/unary/unary_ref_5.ets +03.types/07.value_types/05.character_types_and_operations/unary/unary_ref_6.ets +03.types/07.value_types/05.character_types_and_operations/unary/unary_val_0.ets +03.types/07.value_types/05.character_types_and_operations/unary/unary_val_1.ets +03.types/07.value_types/05.character_types_and_operations/unary/unary_val_2.ets +03.types/07.value_types/05.character_types_and_operations/unary/unary_val_3.ets +03.types/07.value_types/05.character_types_and_operations/unary/unary_val_4.ets +03.types/07.value_types/05.character_types_and_operations/unary/unary_val_5.ets +03.types/07.value_types/05.character_types_and_operations/unary/unary_val_6.ets +03.types/07.value_types/05.character_types_and_operations/concat/conc2.ets +# end of es2panda fails + # es2panda fails: panda#13203 09.classes/01.class_declaration/06.implementing_interface_properties/getter_setter_implementation.ets 10.interfaces/05.interface_properties/getter_setter_form.ets @@ -1928,10 +2033,3 @@ 10.interfaces/05.interface_properties/readonly_simple_form_0.ets 10.interfaces/05.interface_properties/simple_form.ets # end of es2panda fails - -# es2panda fail: panda#13730 -04.names_declarations_and_scopes/08.function_declarations/03.optional_parameters/opt_param_n_0.ets -04.names_declarations_and_scopes/08.function_declarations/03.optional_parameters/opt_param_n_2.ets -04.names_declarations_and_scopes/08.function_declarations/03.optional_parameters/opt_param_n_10.ets -# end of es2panda fails -