Files
mdg-filius/tools/swift-oracle/run.sh
T
julian.kiedaischandClaude Opus 5.5 c80d212c90 feat(fls): DNS records from /dns/hosts, as Java's server answers them
Java's DNS server reads its records from the text file /dns/hosts on every
query. dnsHosts.ts ports that reading (DNSServer.leseRecordListe,
ResourceRecord, Dateisystem.holeDatei) and keeps in the model the records
Java answers: type exactly A, MX or NS, and a name Java accepted. The file
stays in the file system as it is.

Both oracles read 76 hand-picked hosts files (dns-hosts.cases.txt): the
Java oracle through DNSServer.holeResourceRecords (DnsHostsCases), the
Swift oracle through TopologyDNSHostsFileCodec (--dns-hosts). The Java view
matches Java on every case; the model matches Swift except for 33 named
cases in twelve reasons: Java splits at single spaces and LF only, has no
comments or "IN", turns a TTL that is no int into 3600, keeps duplicates,
and empties names with a leading digit. The Swift dump now carries each
server's records; the corpus comparison covers them on 16 files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 06:38:01 +00:00

19 lines
1.2 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
.build/debug/Oracle --dns-hosts /work/packages/fls/test/dns-hosts.cases.txt /work/packages/fls/test/dns-hosts.swift.json'