bugfixes, better MusicXML support and 1.1.0
This commit is contained in:
@@ -8,11 +8,11 @@ import Testing
|
||||
import Foundation
|
||||
@testable @_spi(LyrebirdExtensions) import LyrebirdSynth
|
||||
|
||||
/// NRT `build`-closure shim (Phase 201).
|
||||
/// NRT `build`-closure shim.
|
||||
///
|
||||
/// `NRTJob.build` is a non-isolated `@Sendable (SynthesisEngine) throws -> Void`
|
||||
/// that `EngineHost._executeJob` runs on a background task — *not* the main actor.
|
||||
/// `SynthesisEngine.add(_:)` is `@MainActor` (Phase 201), so it cannot be invoked
|
||||
/// `SynthesisEngine.add(_:)` is `@MainActor`, so it cannot be invoked
|
||||
/// directly from inside the off-main build closure. The build closure runs *before*
|
||||
/// `engine.start()`, so the engine is not yet rendering and nothing else touches it
|
||||
/// concurrently; hopping the add onto the main actor synchronously is therefore safe
|
||||
@@ -29,9 +29,9 @@ private func nrtBuildAdd(_ engine: SynthesisEngine, _ makeSynth: @escaping @Main
|
||||
if let thrown: any Error = thrown { throw thrown }
|
||||
}
|
||||
|
||||
/// Phase 197 — `EngineHost` facade coverage.
|
||||
/// `EngineHost` facade coverage.
|
||||
@MainActor
|
||||
@Suite("EngineHost (Phase 197)")
|
||||
@Suite("EngineHost")
|
||||
struct EngineHostTests {
|
||||
|
||||
// MARK: - Test helpers
|
||||
@@ -95,7 +95,7 @@ struct EngineHostTests {
|
||||
}
|
||||
}
|
||||
|
||||
/// Phase 197 re-review fix: pre-check throw must not leak the
|
||||
/// Pre-check throw must not leak the
|
||||
/// host lock. If `_validateRoleUnlocked` threw without `defer`-ed
|
||||
/// unlock, every subsequent host call on the same instance would
|
||||
/// deadlock on `_lock.lock()`. This test asserts the host is
|
||||
@@ -125,10 +125,10 @@ struct EngineHostTests {
|
||||
|
||||
/// Same-`.rtOutput(deviceID:)` re-registration throws
|
||||
/// `.duplicateRole` because the `Hashable` enum case already
|
||||
/// discriminates by deviceID. Phase 198 (F8) dropped the dead
|
||||
/// discriminates by deviceID. The dead
|
||||
/// `.duplicateDevice` enum case that would have covered cross-role
|
||||
/// same-device collisions — re-add when a future role shape
|
||||
/// requires it.
|
||||
/// same-device collisions was dropped — re-add when a future role
|
||||
/// shape requires it.
|
||||
@Test func makeEngineSameRtOutputRoleTwiceThrowsDuplicateRole() throws {
|
||||
let host: EngineHost = EngineHost()
|
||||
_ = try host.makeEngine(role: .rtOutput(deviceID: 42), config: makeConfig())
|
||||
@@ -325,7 +325,7 @@ struct EngineHostTests {
|
||||
#expect(caught is DeliberateBuildFailure)
|
||||
}
|
||||
|
||||
/// Phase 198 (F1 re-review): a `build` closure that deliberately
|
||||
/// A `build` closure that deliberately
|
||||
/// throws `CancellationError` must propagate as a stream-level
|
||||
/// throw, not be misclassified as a caller-cancel and silently
|
||||
/// swallowed. The outer-catch `Task.isCancelled` guard distinguishes
|
||||
@@ -361,7 +361,7 @@ struct EngineHostTests {
|
||||
"got \(String(describing: caught))"))
|
||||
}
|
||||
|
||||
/// Phase 198 (F1): caller breaking the for-await early must finish
|
||||
/// Caller breaking the for-await early must finish
|
||||
/// the stream cleanly, not throw `CancellationError`. The earlier
|
||||
/// implementation forwarded the cooperative-cancel from
|
||||
/// `withThrowingTaskGroup`'s for-await into `continuation.finish(throwing:)`,
|
||||
|
||||
Reference in New Issue
Block a user