Keep Swift range operators in the fingerprint.

..< and ... were dropped as punctuation, so a half-open range and a
closed range scored 1.0. They now stay, as >= and != do.

Proved by test_a_different_swift_range_lowers_the_score. The suite
is 93 passed.

Co-authored-by: Robert C. Martin <[email protected]>
This commit is contained in:
Cursor Agent
2026-11-25 23:49:25 +00:00
co-authored by Robert C. Martin
parent 1bb1936ad5
commit 121fb2f4ba
3 changed files with 16 additions and 1 deletions
+13
View File
@@ -105,6 +105,19 @@ def test_a_different_swift_operator_lowers_the_score(tmp_path):
) < 1.0
def test_a_different_swift_range_lowers_the_score(tmp_path):
assert _scored(
tmp_path,
"func alpha(xs: Int) -> Bool {\n return xs..<1\n}\n",
"func beta(items: Int) -> Bool {\n return items..<2\n}\n",
) == 1.0
assert _scored(
tmp_path,
"func alpha(xs: Int) -> Bool {\n return xs..<1\n}\n",
"func beta(items: Int) -> Bool {\n return items...1\n}\n",
) < 1.0
def test_a_swift_argument_label_is_part_of_the_call(tmp_path):
assert _scored(
tmp_path,