From 0fb245c6af4be4a19f635da7ec9b3a8cdb257f05 Mon Sep 17 00:00:00 2001 From: levBagryansky <28lev11@gmail.com> Date: Thu, 9 May 2024 16:17:11 +0300 Subject: [PATCH 1/2] #3177: Added wide test of rust-plus --- .../src/test/eo/org/eolang/rust-tests.eo | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/eo-runtime/src/test/eo/org/eolang/rust-tests.eo b/eo-runtime/src/test/eo/org/eolang/rust-tests.eo index 6b349b563a..39a064dfe7 100644 --- a/eo-runtime/src/test/eo/org/eolang/rust-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/rust-tests.eo @@ -471,3 +471,71 @@ org. Q 00-00-00-00-00-00-00-02 + +# This is the default 64+ symbols comment in front of named abstract object. +[] > rust-unwrapped-plus + int. > a + eolang. + org. + Q + bytes.:0 + eolang. + org. + Q + 00-00-00-00-00-00-00-05 + int. > b + eolang. + org. + Q + bytes.:0 + eolang. + org. + Q + 00-00-00-00-00-00-00-0A + rust. > plus + eolang. + org. + Q + string.:0 + eolang. + org. + Q + bytes.:0 + eolang. + org. + Q + 75-73-65-20-65-6F-3A-3A-50-6F-72-74-61-6C-3B-0A-75-73-65-20-65-6F-3A-3A-65-6F-5F-65-6E-75-6D-3A-3A-45-4F-3B-0A-75-73-65-20-65-6F-3A-3A-65-6F-5F-65-6E-75-6D-3A-3A-45-4F-3A-3A-7B-45-4F-49-6E-74-7D-3B-0A-75-73-65-20-62-79-74-65-6F-72-64-65-72-3A-3A-7B-42-69-67-45-6E-64-69-61-6E-2C-20-52-65-61-64-42-79-74-65-73-45-78-74-7D-3B-0A-0A-70-75-62-20-66-6E-20-66-6F-6F-28-70-6F-72-74-61-6C-3A-20-26-6D-75-74-20-50-6F-72-74-61-6C-29-20-2D-3E-20-4F-70-74-69-6F-6E-3C-45-4F-3E-20-7B-0A-20-20-6C-65-74-20-61-20-3D-20-70-6F-72-74-61-6C-2E-66-69-6E-64-28-22-24-2E-5E-2E-61-22-29-3F-3B-0A-20-20-6C-65-74-20-62-79-74-65-73-5F-61-20-3D-20-70-6F-72-74-61-6C-2E-64-61-74-61-69-7A-65-28-61-29-3F-3B-0A-20-20-6C-65-74-20-61-20-3D-20-62-79-74-65-73-5F-61-2E-61-73-5F-73-6C-69-63-65-28-29-2E-72-65-61-64-5F-69-36-34-3A-3A-3C-42-69-67-45-6E-64-69-61-6E-3E-28-29-2E-6F-6B-28-29-3F-3B-0A-0A-20-20-6C-65-74-20-62-20-3D-20-70-6F-72-74-61-6C-2E-66-69-6E-64-28-22-24-2E-5E-2E-62-22-29-3F-3B-0A-20-20-6C-65-74-20-62-79-74-65-73-5F-62-20-3D-20-70-6F-72-74-61-6C-2E-64-61-74-61-69-7A-65-28-62-29-3F-3B-0A-20-20-6C-65-74-20-62-20-3D-20-62-79-74-65-73-5F-62-2E-61-73-5F-73-6C-69-63-65-28-29-2E-72-65-61-64-5F-69-36-34-3A-3A-3C-42-69-67-45-6E-64-69-61-6E-3E-28-29-2E-6F-6B-28-29-3F-3B-0A-20-20-70-72-69-6E-74-6C-6E-21-28-22-73-75-6D-20-35-20-2B-20-31-30-20-3D-20-7B-7D-22-2C-20-61-20-2B-20-62-29-3B-0A-20-20-53-6F-6D-65-28-45-4F-49-6E-74-28-61-20-2B-20-62-29-29-0A-7D + auto-named-attr-at-327-6.:1 + $ + tuple.:2 + eolang. + org. + Q + empty.:0 + tuple. + eolang. + org. + Q + string.:1 + eolang. + org. + Q + bytes.:0 + eolang. + org. + Q + 62-79-74-65-6F-72-64-65-72-3A-31-2E-34-2E-33 + eq. > @ + plus. + $ + int.:0 + eolang. + org. + Q + bytes.:0 + eolang. + org. + Q + 00-00-00-00-00-00-00-0F + # This is the default 64+ symbols comment in front of named abstract object. + [] > auto-named-attr-at-327-6 From 527921d28dc334d6cc6dc4ced0bcefee48835303 Mon Sep 17 00:00:00 2001 From: levBagryansky <28lev11@gmail.com> Date: Thu, 9 May 2024 16:18:16 +0300 Subject: [PATCH 2/2] #3177: check wide form in add-rust --- .../org/eolang/maven/add_rust/add_rust.xsl | 4 +- ...> detects-rust-code-with-wide-string.yaml} | 0 ...ts-rust-dependencies-with-wide-string.yaml | 275 ++++++++++++++++++ 3 files changed, 277 insertions(+), 2 deletions(-) rename eo-maven-plugin/src/test/resources/org/eolang/maven/binarize/add_rust/{detects-rust-with-wide-string.yaml => detects-rust-code-with-wide-string.yaml} (100%) create mode 100644 eo-maven-plugin/src/test/resources/org/eolang/maven/binarize/add_rust/detects-rust-dependencies-with-wide-string.yaml diff --git a/eo-maven-plugin/src/main/resources/org/eolang/maven/add_rust/add_rust.xsl b/eo-maven-plugin/src/main/resources/org/eolang/maven/add_rust/add_rust.xsl index 5386392bfc..c6b22b0b62 100644 --- a/eo-maven-plugin/src/main/resources/org/eolang/maven/add_rust/add_rust.xsl +++ b/eo-maven-plugin/src/main/resources/org/eolang/maven/add_rust/add_rust.xsl @@ -42,10 +42,10 @@ SOFTWARE. - + - + diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/binarize/add_rust/detects-rust-with-wide-string.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/binarize/add_rust/detects-rust-code-with-wide-string.yaml similarity index 100% rename from eo-maven-plugin/src/test/resources/org/eolang/maven/binarize/add_rust/detects-rust-with-wide-string.yaml rename to eo-maven-plugin/src/test/resources/org/eolang/maven/binarize/add_rust/detects-rust-code-with-wide-string.yaml diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/binarize/add_rust/detects-rust-dependencies-with-wide-string.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/binarize/add_rust/detects-rust-dependencies-with-wide-string.yaml new file mode 100644 index 0000000000..84fa4a5095 --- /dev/null +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/binarize/add_rust/detects-rust-dependencies-with-wide-string.yaml @@ -0,0 +1,275 @@ +# The MIT License (MIT) +# +# Copyright (c) 2016-2024 Objectionary.com +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +--- +sheets: + - /org/eolang/maven/add_rust/add_rust.xsl +document: + + + + + + + + + + + 00 00 00 00 00 00 00 05 + + + + + + + + 00 00 00 00 00 00 00 0A + + + + + + + + + + + + + + 75 73 65 20 65 6F 3A 3A 50 6F 72 74 61 6C 3B 0A 75 73 65 20 65 6F 3A 3A 65 6F 5F 65 6E 75 6D 3A 3A 45 4F 3B 0A 75 73 65 20 65 6F 3A 3A 65 6F 5F 65 6E 75 6D 3A 3A 45 4F 3A 3A 7B 45 4F 49 6E 74 7D 3B 0A 75 73 65 20 62 79 74 65 6F 72 64 65 72 3A 3A 7B 42 69 67 45 6E 64 69 61 6E 2C 20 52 65 61 64 42 79 74 65 73 45 78 74 7D 3B 0A 0A 70 75 62 20 66 6E 20 66 6F 6F 28 70 6F 72 74 61 6C 3A 20 26 6D 75 74 20 50 6F 72 74 61 6C 29 20 2D 3E 20 4F 70 74 69 6F 6E 3C 45 4F 3E 20 7B 0A 20 20 6C 65 74 20 61 20 3D 20 70 6F 72 74 61 6C 2E 66 69 6E 64 28 22 24 2E 5E 2E 61 22 29 3F 3B 0A 20 20 6C 65 74 20 62 79 74 65 73 5F 61 20 3D 20 70 6F 72 74 61 6C 2E 64 61 74 61 69 7A 65 28 61 29 3F 3B 0A 20 20 6C 65 74 20 61 20 3D 20 62 79 74 65 73 5F 61 2E 61 73 5F 73 6C 69 63 65 28 29 2E 72 65 61 64 5F 69 36 34 3A 3A 3C 42 69 67 45 6E 64 69 61 6E 3E 28 29 2E 6F 6B 28 29 3F 3B 0A 0A 20 20 6C 65 74 20 62 20 3D 20 70 6F 72 74 61 6C 2E 66 69 6E 64 28 22 24 2E 5E 2E 62 22 29 3F 3B 0A 20 20 6C 65 74 20 62 79 74 65 73 5F 62 20 3D 20 70 6F 72 74 61 6C 2E 64 61 74 61 69 7A 65 28 62 29 3F 3B 0A 20 20 6C 65 74 20 62 20 3D 20 62 79 74 65 73 5F 62 2E 61 73 5F 73 6C 69 63 65 28 29 2E 72 65 61 64 5F 69 36 34 3A 3A 3C 42 69 67 45 6E 64 69 61 6E 3E 28 29 2E 6F 6B 28 29 3F 3B 0A 20 20 70 72 69 6E 74 6C 6E 21 28 22 73 75 6D 20 35 20 2B 20 31 30 20 3D 20 7B 7D 22 2C 20 61 20 2B 20 62 29 3B 0A 20 20 53 6F 6D 65 28 45 4F 49 6E 74 28 61 20 2B 20 62 29 29 0A 7D + + + + + + + + + + + + + + + + + + + + + + + + + + 62 79 74 65 6F 72 64 65 72 3A 31 2E 34 2E 33 + + + + + + + + + + + + + + 00 00 00 00 00 00 00 0F + + + + + + + +asserts: + - /program/rusts/rust[@code_loc='Φ.org.eolang.rust-unwrapped-plus.plus.α0' and @code='75 73 65 20 65 6F 3A 3A 50 6F 72 74 61 6C 3B 0A 75 73 65 20 65 6F 3A 3A 65 6F 5F 65 6E 75 6D 3A 3A 45 4F 3B 0A 75 73 65 20 65 6F 3A 3A 65 6F 5F 65 6E 75 6D 3A 3A 45 4F 3A 3A 7B 45 4F 49 6E 74 7D 3B 0A 75 73 65 20 62 79 74 65 6F 72 64 65 72 3A 3A 7B 42 69 67 45 6E 64 69 61 6E 2C 20 52 65 61 64 42 79 74 65 73 45 78 74 7D 3B 0A 0A 70 75 62 20 66 6E 20 66 6F 6F 28 70 6F 72 74 61 6C 3A 20 26 6D 75 74 20 50 6F 72 74 61 6C 29 20 2D 3E 20 4F 70 74 69 6F 6E 3C 45 4F 3E 20 7B 0A 20 20 6C 65 74 20 61 20 3D 20 70 6F 72 74 61 6C 2E 66 69 6E 64 28 22 24 2E 5E 2E 61 22 29 3F 3B 0A 20 20 6C 65 74 20 62 79 74 65 73 5F 61 20 3D 20 70 6F 72 74 61 6C 2E 64 61 74 61 69 7A 65 28 61 29 3F 3B 0A 20 20 6C 65 74 20 61 20 3D 20 62 79 74 65 73 5F 61 2E 61 73 5F 73 6C 69 63 65 28 29 2E 72 65 61 64 5F 69 36 34 3A 3A 3C 42 69 67 45 6E 64 69 61 6E 3E 28 29 2E 6F 6B 28 29 3F 3B 0A 0A 20 20 6C 65 74 20 62 20 3D 20 70 6F 72 74 61 6C 2E 66 69 6E 64 28 22 24 2E 5E 2E 62 22 29 3F 3B 0A 20 20 6C 65 74 20 62 79 74 65 73 5F 62 20 3D 20 70 6F 72 74 61 6C 2E 64 61 74 61 69 7A 65 28 62 29 3F 3B 0A 20 20 6C 65 74 20 62 20 3D 20 62 79 74 65 73 5F 62 2E 61 73 5F 73 6C 69 63 65 28 29 2E 72 65 61 64 5F 69 36 34 3A 3A 3C 42 69 67 45 6E 64 69 61 6E 3E 28 29 2E 6F 6B 28 29 3F 3B 0A 20 20 70 72 69 6E 74 6C 6E 21 28 22 73 75 6D 20 35 20 2B 20 31 30 20 3D 20 7B 7D 22 2C 20 61 20 2B 20 62 29 3B 0A 20 20 53 6F 6D 65 28 45 4F 49 6E 74 28 61 20 2B 20 62 29 29 0A 7D'] + - /program/rusts/rust[@code_loc='Φ.org.eolang.rust-unwrapped-plus.plus.α0']/dependencies/dependency[@name="62 79 74 65 6F 72 64 65 72 3A 31 2E 34 2E 33"]