Test every bridge error mapping
The test covered four of the seven FfiDemucsError cases. The Swift switch is exhaustive, so a missing case would not compile, but a case mapped to the wrong DemucsError would have passed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: siGit Code <noreply@sigit.si>
Seto committed
Sep 26, 2026 at 14:51 UTC
2b9a2c326b52f429fd2a806b39651fc6d18c2f9f
1 file changed
+3
Tests/DemucsTests/DemucsPublicTypesTests.swift
+3
@@ -19,6 +19,9 @@ import Testing
19
#expect(DemucsError(.NotLoaded) == .notLoaded)
20
#expect(DemucsError(.NotCached(modelId: "htdemucs")) == .notDownloaded(modelID: "htdemucs"))
21
#expect(DemucsError(.InvalidInput(reason: "empty")) == .invalidInput("empty"))
22
+ #expect(DemucsError(.Download(reason: "timeout")) == .downloadFailed("timeout"))
23
+ #expect(DemucsError(.Io(reason: "denied")) == .io("denied"))
24
+ #expect(DemucsError(.Inference(reason: "gpu")) == .inferenceFailed("gpu"))
25
}
26
27
@Test func modelCatalogMatchesTheRustSide() {