Skip to content

Commit bfa006b

Browse files
Fix feature detection for spectest for Windows path
1 parent 3da34d6 commit bfa006b

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Sources/Spectest/TestCase.swift

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -412,9 +412,9 @@ extension TestCase.Command {
412412
}
413413
}
414414

415-
private func deriveFeatureSet(rootPath: String) -> WasmFeatureSet {
415+
private func deriveFeatureSet(rootPath: FilePath) -> WasmFeatureSet {
416416
var features = WasmFeatureSet.default
417-
if rootPath.hasSuffix("/proposals/memory64") {
417+
if rootPath.ends(with: "proposals/memory64") {
418418
features.insert(.memory64)
419419
// memory64 doesn't expect reference-types proposal
420420
// and it depends on the fact reference-types is disabled
@@ -424,9 +424,10 @@ extension TestCase.Command {
424424
}
425425

426426
private func parseModule(rootPath: String, filename: String) throws -> Module {
427-
let url = URL(fileURLWithPath: rootPath).appendingPathComponent(filename)
427+
let rootPath = FilePath(rootPath)
428+
let path = rootPath.appending(filename)
428429

429-
let module = try parseWasm(filePath: FilePath(url.path), features: deriveFeatureSet(rootPath: rootPath))
430+
let module = try parseWasm(filePath: path, features: deriveFeatureSet(rootPath: rootPath))
430431
return module
431432
}
432433

0 commit comments

Comments
 (0)