Files
julian.kiedaischandClaude Opus 5.5 a198d10b4a feat(core): virtual file system and Swift string semantics
The core gains Swift's virtual file system (paths, case-insensitive
lookup that keeps the spelling, quotas, atomic changes, the defaults of
a new device) and the string behaviour the ported code relies on without
saying so. Both are measured in the Swift oracle: 11 file system cases
(the three Swift tests among them) step by step, and trimming, lower
case, equality, ordering and Base64 case by case — whitespace and control
characters over all of Unicode.

Found by measuring:
- Swift trims NEL and ZERO WIDTH SPACE, not the BOM; JS trim() does the
  opposite. The .fls import now trims with swiftTrim.
- lowercased() maps scalar by scalar: a word-final sigma stays σ.
- Foundation decodes "====" and "Y===" as empty data.
- Foundation on Linux counts 24,735 plane-14 scalars as control
  characters, a table artefact; the port keeps Unicode Cc+Cf.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 21:23:45 +00:00

569 lines
8.5 KiB
JSON

[
{
"name": "whitespace components and case-insensitive siblings (Swift test)",
"steps": [
{
"op": "createDirectory",
"path": "/docs"
},
{
"op": "writeText",
"path": "/docs/Readme.txt",
"text": "one"
},
{
"op": "writeText",
"path": "/docs/ note.txt",
"text": "two"
},
{
"op": "writeText",
"path": "/DOCS/readme.TXT",
"text": "two",
"overwrite": true
},
{
"op": "text",
"path": "/docs/Readme.txt"
},
{
"op": "entry",
"path": "/DOCS/README.TXT"
},
{
"op": "writeText",
"path": "/docs/README.txt",
"text": "three",
"overwrite": false
},
{
"op": "fromEntries",
"entries": [
{
"path": "/docs",
"kind": "directory"
},
{
"path": "/docs/Readme.txt",
"kind": "text",
"text": "one"
},
{
"path": "/docs/readme.TXT",
"kind": "text",
"text": "two"
}
]
}
]
},
{
"name": "quotas are explicit and atomic (Swift test)",
"steps": [
{
"op": "writeBinary",
"path": "/oversized.bin",
"size": 8388609,
"byte": 65
},
{
"op": "contains",
"path": "/oversized.bin"
},
{
"op": "writeBinary",
"path": "/file-0.bin",
"size": 8388608,
"byte": 66
},
{
"op": "writeBinary",
"path": "/file-1.bin",
"size": 8388608,
"byte": 66
},
{
"op": "writeBinary",
"path": "/file-2.bin",
"size": 8388608,
"byte": 66
},
{
"op": "writeBinary",
"path": "/file-3.bin",
"size": 8388608,
"byte": 66
},
{
"op": "writeBinary",
"path": "/file-4.bin",
"size": 8388608,
"byte": 66
},
{
"op": "contains",
"path": "/file-4.bin"
}
]
},
{
"name": "overwrite uses the final state's quota, move is atomic (Swift test)",
"steps": [
{
"op": "writeBinary",
"path": "/source.bin",
"size": 8388608,
"byte": 65,
"mediaType": "application/octet-stream"
},
{
"op": "writeBinary",
"path": "/destination.bin",
"size": 8388608,
"byte": 65,
"mediaType": "application/octet-stream"
},
{
"op": "writeBinary",
"path": "/third.bin",
"size": 8388608,
"byte": 65,
"mediaType": "application/octet-stream"
},
{
"op": "writeBinary",
"path": "/fourth.bin",
"size": 8388608,
"byte": 65,
"mediaType": "application/octet-stream"
},
{
"op": "copy",
"path": "/SOURCE.BIN",
"to": "/DESTINATION.BIN",
"overwrite": true
},
{
"op": "copy",
"path": "/source.bin",
"to": "/new.bin",
"overwrite": true
},
{
"op": "move",
"path": "/SOURCE.BIN",
"to": "/DESTINATION.BIN",
"overwrite": true
},
{
"op": "contains",
"path": "/source.bin"
},
{
"op": "contains",
"path": "/destination.bin"
}
]
},
{
"name": "path normalization",
"steps": [
{
"op": "normalize",
"path": "a"
},
{
"op": "normalize",
"path": "/"
},
{
"op": "normalize",
"path": "/a/./b/../c"
},
{
"op": "normalize",
"path": "/.."
},
{
"op": "normalize",
"path": "/a/../.."
},
{
"op": "normalize",
"path": "\\a\\b"
},
{
"op": "normalize",
"path": "/a/ b"
},
{
"op": "normalize",
"path": "/a/b "
},
{
"op": "normalize",
"path": "/a/b\u0007"
},
{
"op": "normalize",
"path": "/a/b\u200b"
},
{
"op": "normalize",
"path": "//a//b//"
},
{
"op": "normalize",
"path": "/a/..."
},
{
"op": "normalize",
"path": "/a/\u0085b"
},
{
"op": "normalize",
"path": "/a/\ufeffb"
},
{
"op": "normalize",
"path": "/a/\u00a0b\u00a0"
},
{
"op": "normalize",
"path": "/\u00e9/e\u0301"
}
]
},
{
"name": "canonical equivalence and scalar-wise lower case",
"steps": [
{
"op": "createDirectory",
"path": "/\u00e9"
},
{
"op": "entry",
"path": "/e\u0301"
},
{
"op": "writeText",
"path": "/E\u0301/x.txt",
"text": "1"
},
{
"op": "createDirectory",
"path": "/e\u0301"
},
{
"op": "createDirectory",
"path": "/\u039f\u0394\u039f\u03a3"
},
{
"op": "entry",
"path": "/\u03bf\u03b4\u03bf\u03c3"
},
{
"op": "entry",
"path": "/\u03bf\u03b4\u03bf\u03c2"
},
{
"op": "createDirectory",
"path": "/Stra\u00dfe"
},
{
"op": "createDirectory",
"path": "/STRASSE"
},
{
"op": "createDirectory",
"path": "/\u212aelvin"
},
{
"op": "entry",
"path": "/kelvin"
}
]
},
{
"name": "listing order",
"steps": [
{
"op": "writeText",
"path": "/b.txt",
"text": "b.txt"
},
{
"op": "writeText",
"path": "/a.txt",
"text": "a.txt"
},
{
"op": "writeText",
"path": "/Zeta",
"text": "Zeta"
},
{
"op": "writeText",
"path": "/\u00e9mile",
"text": "\u00e9mile"
},
{
"op": "writeText",
"path": "/file10",
"text": "file10"
},
{
"op": "writeText",
"path": "/file2",
"text": "file2"
},
{
"op": "writeText",
"path": "/\uff5e",
"text": "\uff5e"
},
{
"op": "writeText",
"path": "/\ud83d\ude00",
"text": "\ud83d\ude00"
},
{
"op": "createDirectory",
"path": "/zdir"
},
{
"op": "createDirectory",
"path": "/Adir"
},
{
"op": "entries",
"path": "/"
}
]
},
{
"name": "copy, move, rename and delete trees",
"steps": [
{
"op": "createDirectory",
"path": "/a/b/c",
"recursive": true
},
{
"op": "writeText",
"path": "/a/b/c/f.txt",
"text": "f"
},
{
"op": "writeText",
"path": "/a/g.txt",
"text": "g"
},
{
"op": "copy",
"path": "/a",
"to": "/a/b/x"
},
{
"op": "copy",
"path": "/a/b",
"to": "/"
},
{
"op": "copy",
"path": "/A/B",
"to": "/copy"
},
{
"op": "entries",
"path": "/copy/c"
},
{
"op": "move",
"path": "/copy",
"to": "/a/moved"
},
{
"op": "move",
"path": "/a",
"to": "/a/b"
},
{
"op": "rename",
"path": "/a/moved",
"name": "Renamed"
},
{
"op": "rename",
"path": "/a/g.txt",
"name": "x/y"
},
{
"op": "delete",
"path": "/a"
},
{
"op": "delete",
"path": "/",
"recursive": true
},
{
"op": "copy",
"path": "/a/g.txt",
"to": "/a/b",
"overwrite": true
},
{
"op": "copy",
"path": "/a/b",
"to": "/a/g.txt",
"overwrite": true
},
{
"op": "delete",
"path": "/A/b",
"recursive": true
},
{
"op": "writeText",
"path": "/a",
"text": "x"
},
{
"op": "text",
"path": "/a"
},
{
"op": "createDirectory",
"path": "/a/g.txt/x"
},
{
"op": "createDirectory",
"path": "/q/r"
}
]
},
{
"name": "file kinds",
"steps": [
{
"op": "writeImage",
"path": "/i.png",
"size": 10,
"byte": 1,
"mediaType": "image/png"
},
{
"op": "text",
"path": "/i.png"
},
{
"op": "writeText",
"path": "/",
"text": "x"
},
{
"op": "writeText",
"path": "/missing/x.txt",
"text": "x"
},
{
"op": "entry",
"path": "/i.png"
}
]
},
{
"name": "defaults of a new device",
"steps": [
{
"op": "default"
},
{
"op": "entries",
"path": "/images"
}
]
},
{
"name": "entries need their parents",
"steps": [
{
"op": "fromEntries",
"entries": [
{
"path": "/a/b",
"kind": "text",
"text": "x"
}
]
},
{
"op": "fromEntries",
"entries": [
{
"path": "/",
"kind": "directory"
}
]
},
{
"op": "fromEntries",
"entries": [
{
"path": "/b",
"kind": "directory"
},
{
"path": "/b/c",
"kind": "text",
"text": "c"
},
{
"path": "/a",
"kind": "text",
"text": "a"
}
]
}
]
},
{
"name": "canonically equal entries are one path",
"steps": [
{
"op": "fromEntries",
"entries": [
{
"path": "/\u00e9",
"kind": "text",
"text": "composed"
},
{
"path": "/e\u0301",
"kind": "text",
"text": "decomposed"
}
]
},
{
"op": "fromEntries",
"entries": [
{
"path": "/\u00e9",
"kind": "directory"
},
{
"path": "/e\u0301/x",
"kind": "text",
"text": "x"
}
]
},
{
"op": "entries",
"path": "/"
}
]
}
]