Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions tests/fixtures/case-collide.cases.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,36 @@
}
],
"message": "character element ids \"é1\" and \"é1\" give the file names \"bob--é1.json\" and \"bob--é1.json\", which are one name once folded (NFC, then simple case folding), so a case-insensitive disk (NTFS, APFS) may keep one file for both."
},
{
"elements": [
{
"type": "character",
"id": "ς1",
"name": ""
},
{
"type": "character",
"id": "σ1",
"name": ""
}
],
"message": "character element ids \"ς1\" and \"σ1\" give the file names \"ς1.json\" and \"σ1.json\", which are one name once folded (NFC, then simple case folding), so a case-insensitive disk (NTFS, APFS) may keep one file for both."
},
{
"elements": [
{
"type": "character",
"id": "ς1",
"name": "Bob"
},
{
"type": "character",
"id": "σ1",
"name": "Bob"
}
],
"message": "character element ids \"ς1\" and \"σ1\" give the file names \"bob--ς1.json\" and \"bob--σ1.json\", which are one name once folded (NFC, then simple case folding), so a case-insensitive disk (NTFS, APFS) may keep one file for both."
}
],
"written": [
Expand Down Expand Up @@ -375,6 +405,24 @@
"elements/character/bob--1234567K.json",
"elements/character/bob--b1234567k.json"
]
},
{
"elements": [
{
"type": "character",
"id": "𝐚-12345678",
"name": "Bob"
},
{
"type": "character",
"id": "a-12345678",
"name": "Bob"
}
],
"paths": [
"elements/character/bob--12345678.json",
"elements/character/bob--𝐚-12345678.json"
]
}
]
}
6 changes: 3 additions & 3 deletions tests/test_case_collide.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from onlyworlds import write_folder

FIXTURE = Path(__file__).resolve().parent / "fixtures" / "case-collide.cases.json"
FIXTURE_SHA256 = "7fec915c2207aa654c01587076883fbdd693dc9f2c5e604733360573ff838b12"
FIXTURE_SHA256 = "6458bd08ad90de5dbc8c2f1fd4c52dca415cdd04bdd646555f4a00c787d0fd48"
W = {"id": "w-1", "name": "W"}


Expand Down Expand Up @@ -47,8 +47,8 @@ def test_the_cases_file_is_the_pinned_bytes() -> None:
assert hashlib.sha256(FIXTURE.read_bytes()).hexdigest() == FIXTURE_SHA256
data = _data()
assert data["version"] == 1
assert len(data["refused"]) == 14
assert len(data["written"]) == 9
assert len(data["refused"]) == 16
assert len(data["written"]) == 10


@pytest.mark.parametrize("reverse", [False, True], ids=["given", "reversed"])
Expand Down