fix(coords): Chunk-Namen korrekt für Float-Indizes und Newlines
- chunk_name: Reject float/bool indices like JavaScript (Number.isInteger) - parse_chunk_name: Use fullmatch instead of match($) to reject strings with trailing newlines - Add invalidIndices fixture cases to catch these edge cases in both languages Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2f63779363
commit
f0f7692f14
4 files changed
+20
-4
No files matched your search
@@ -43,3 +43,8 @@ def test_chunk_names_round_trip_for_all_144_chunks():
|
||||
for i in range(12):
|
||||
for j in range(12):
|
||||
assert parse_chunk_name(chunk_name(i, j)) == (i, j)
|
||||
|
||||
|
||||
def test_chunk_names_reject_invalid_index_types():
|
||||
for i, j in NAMES["invalidIndices"]:
|
||||
assert chunk_name(i, j) is None
|
||||
Reference in new issue
Block a user