From f27dce68380658b1018a84f4018b2d947ea0eb87 Mon Sep 17 00:00:00 2001 From: l0ng-ai <24760907+l0ng-ai@users.noreply.github.com> Date: Mon, 24 Aug 2026 00:43:55 +0800 Subject: [PATCH] test(smart-select): give each half of the angle-bracket rule a line to refuse MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `<` only pairs when neither end is padded — a generic or a tag, not a comparison. Every negative fixture put a space on both sides, so either half of that rule threw them all out and neither half was ever the one deciding. Dropping the opening check left the whole suite green while `if a < b, x>y` started selecting `< b, x>` on a click, and dropping the closing check did the same for `echo b`. Two lines with a space on one side only, so each half has a case that is its alone. --- src/terminal/smart_select.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/terminal/smart_select.rs b/src/terminal/smart_select.rs index 0c39d42f..32e42bbc 100644 --- a/src/terminal/smart_select.rs +++ b/src/terminal/smart_select.rs @@ -883,6 +883,12 @@ mod tests { "awk '{ if ($1 > 100 && $2 < 5) print }'", "WHERE a < 10 AND b > 20", "empty <> pair", + // Both of the above put a space on each side, so either half of + // the rule alone throws them out and neither half is ever the one + // being asked. These two put a space on one side only, so each + // half has a line that only it can refuse. + "if a < b, x>y", + "echo b", ] { let chars: Vec = text.chars().collect(); for (i, &c) in chars.iter().enumerate() {