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>
18 lines
1.0 KiB
Bash
Executable File
18 lines
1.0 KiB
Bash
Executable File
#!/bin/sh
|
|
# Replays every scenario under packages/core/test/scenarios in the Swift core
|
|
# and writes the reference result next to it (<name>.swift.json).
|
|
# Needs Docker; the TypeScript tests only read the written files.
|
|
set -eu
|
|
here="$(cd "$(dirname "$0")" && pwd)"
|
|
root="$(cd "$here/../.." && pwd)"
|
|
[ -d "$here/Sources/FiliusCore" ] || "$here/fetch-upstream.sh"
|
|
# A failed build must stop here: a stale binary would write stale references.
|
|
docker run --rm -v "$root:/work" -w /work/tools/swift-oracle swift:6.1-jammy sh -c '
|
|
set -e
|
|
swift build -q
|
|
.build/debug/Oracle /work/packages/core/test/scenarios
|
|
.build/debug/Oracle --corpus /work/corpus /work/corpus/corpus.swift.json
|
|
.build/debug/Oracle --vfs /work/packages/core/test/vfs.cases.json /work/packages/core/test/vfs.swift.json
|
|
.build/debug/Oracle --strings /work/packages/core/test/strings.cases.json /work/packages/core/test/strings.swift.json
|
|
.build/debug/Oracle --path-folding /work/packages/fls/test/path-folding.cases.json /work/packages/fls/test/path-folding.swift.json'
|