From b3164d64f46a2c9e606f4ff833082b94d460900c Mon Sep 17 00:00:00 2001 From: Ilya Sherenkov Date: Thu, 12 Nov 2026 03:14:34 +0300 Subject: [PATCH] #1697: skip unit tests written as applications in compound-name --- .../org/eolang/lints/names/compound-name.xsl | 10 ++++++++- ...ws-unit-tests-written-as-applications.yaml | 21 +++++++++++++++++++ ...nd-attribute-next-to-application-test.yaml | 16 ++++++++++++++ 3 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 src/test/resources/org/eolang/lints/packs/single/compound-name/allows-unit-tests-written-as-applications.yaml create mode 100644 src/test/resources/org/eolang/lints/packs/single/compound-name/catches-compound-attribute-next-to-application-test.yaml diff --git a/src/main/resources/org/eolang/lints/names/compound-name.xsl b/src/main/resources/org/eolang/lints/names/compound-name.xsl index 280f0f914..c2ee86af4 100644 --- a/src/main/resources/org/eolang/lints/names/compound-name.xsl +++ b/src/main/resources/org/eolang/lints/names/compound-name.xsl @@ -7,6 +7,7 @@ + @@ -27,7 +28,14 @@ - + + diff --git a/src/test/resources/org/eolang/lints/packs/single/compound-name/allows-unit-tests-written-as-applications.yaml b/src/test/resources/org/eolang/lints/packs/single/compound-name/allows-unit-tests-written-as-applications.yaml new file mode 100644 index 000000000..937090b51 --- /dev/null +++ b/src/test/resources/org/eolang/lints/packs/single/compound-name/allows-unit-tests-written-as-applications.yaml @@ -0,0 +1,21 @@ +# SPDX-FileCopyrightText: Copyright (c) 2016-2026 Objectionary.com +# SPDX-License-Identifier: MIT +--- +sheets: + - /org/eolang/lints/names/compound-name.xsl +defects: 0 +input: | + [] > phrase + "Object Thinking" > text + text.index-of " " > pos + + pos.eq 6 +> can-find-space + + eq. +> can-find-space-again + pos + 6 + + text.slice 20 1 -> cannot-slice-past-end + + [] +> can-find-space-in-formation + ^.pos.eq 6 > @ diff --git a/src/test/resources/org/eolang/lints/packs/single/compound-name/catches-compound-attribute-next-to-application-test.yaml b/src/test/resources/org/eolang/lints/packs/single/compound-name/catches-compound-attribute-next-to-application-test.yaml new file mode 100644 index 000000000..835169a23 --- /dev/null +++ b/src/test/resources/org/eolang/lints/packs/single/compound-name/catches-compound-attribute-next-to-application-test.yaml @@ -0,0 +1,16 @@ +# SPDX-FileCopyrightText: Copyright (c) 2016-2026 Objectionary.com +# SPDX-License-Identifier: MIT +--- +sheets: + - /org/eolang/lints/names/compound-name.xsl +asserts: + - /defects[count(defect[@severity='warning'])=1] + - /defects/defect[@line='3'] + - /defects/defect[contains(., 'space-pos')] + - /defects[not(defect[contains(., 'can-find-space')])] +input: | + [] > phrase + "Object Thinking" > text + text.index-of " " > space-pos + + space-pos.eq 6 +> can-find-space