Skip to content

Commit 468fcf3

Browse files
sbryngelsonclaude
andcommitted
Fix UUID heuristic to correctly identify pure-hex strings
The previous check `not t.isalpha()` incorrectly rejects valid 8-char UUIDs composed entirely of A-F characters (e.g. DEADBEEF). MFC UUIDs are CRC32-based 8-char uppercase hex strings, so checking isalpha() introduces false negatives for any UUID whose digits happen to all be A-F. Fix by checking that every character is a valid hex digit using: all(c in '0123456789abcdef' for c in t.lower()) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent a9b1e40 commit 468fcf3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

toolchain/mfc/test/test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def __filter(cases_) -> typing.List[TestCase]:
6868
if len(ARG("only")) > 0:
6969
# UUIDs are 8-char hex (CRC32): use OR so --only UUID1 UUID2 selects
7070
# any matching test. Labels use AND so --only 2D Bubbles selects both.
71-
_uuid_mode = all(len(t) == 8 and t.isalnum() and not t.isalpha() for t in ARG("only"))
71+
_uuid_mode = all(len(t) == 8 and all(c in '0123456789abcdef' for c in t.lower()) for t in ARG("only"))
7272
for case in cases[:]:
7373
case: TestCase
7474

0 commit comments

Comments
 (0)