Skip to content

Commit 22ddae3

Browse files
committed
Add parser tests for transcribe --context flag
Follow-up to #196: cover the new --context option with the same one-test-per-flag pattern as the rest of TranscribeCommandTests (default-nil + parses-value).
1 parent f7c5246 commit 22ddae3

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

Tests/AudioCLITests/AudioCLITests.swift

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,21 @@ final class TranscribeCommandTests: XCTestCase {
8585
XCTAssertEqual(transcribe.language, "zh")
8686
}
8787

88+
func testDefaultContextIsNil() throws {
89+
let cmd = try AudioCLI.parseAsRoot(["transcribe", "audio.wav"])
90+
let transcribe = try XCTUnwrap(cmd as? TranscribeCommand)
91+
XCTAssertNil(transcribe.context)
92+
}
93+
94+
func testParsesContext() throws {
95+
let cmd = try AudioCLI.parseAsRoot([
96+
"transcribe", "audio.wav",
97+
"--context", "Project: Meander, participants: Will, Adam"
98+
])
99+
let transcribe = try XCTUnwrap(cmd as? TranscribeCommand)
100+
XCTAssertEqual(transcribe.context, "Project: Meander, participants: Will, Adam")
101+
}
102+
88103
func testParsesFullModelId() throws {
89104
let cmd = try AudioCLI.parseAsRoot(["transcribe", "audio.wav", "-m", "org/my-custom-model"])
90105
let transcribe = try XCTUnwrap(cmd as? TranscribeCommand)

0 commit comments

Comments
 (0)