feat:mac os

This commit is contained in:
intelligence committed 2026-08-29 19:58:33 +02:00
1 parent 136bf7cfa3
commit 3400e2b465
18 files changed
+1129

No files matched your search

@@ -0,0 +1,30 @@
import XCTest
@testable import Transui
final class TranscriptCleanerTests: XCTestCase {
func testRemovesAsTextPrefix() {
XCTAssertEqual(
TranscriptCleaner.clean("language English<astext>Hello there"),
"Hello there"
)
}
func testRemovesAsrTextPrefix() {
XCTAssertEqual(
TranscriptCleaner.clean("language zh <asr_text>你好"),
"你好"
)
}
func testRemovesPrefixAfterWhitespaceAndBom() {
XCTAssertEqual(
TranscriptCleaner.clean("\u{FEFF} \n\tlanguage English<astext>Hello"),
"Hello"
)
}
func testPreservesOrdinaryTranscript() {
XCTAssertEqual(TranscriptCleaner.clean("language is useful"), "language is useful")
}
}
@@ -0,0 +1,26 @@
import XCTest
@testable import Transui
final class TranscriptionClientTests: XCTestCase {
func testAddsTranscriptionPath() {
XCTAssertEqual(
TranscriptionClient.endpointURL(from: "https://example.com/")?.absoluteString,
"https://example.com/v1/audio/transcriptions"
)
}
func testKeepsFullTranscriptionPath() {
XCTAssertEqual(
TranscriptionClient.endpointURL(
from: "https://example.com/v1/audio/transcriptions"
)?.absoluteString,
"https://example.com/v1/audio/transcriptions"
)
}
func testRejectsInvalidEndpoint() {
XCTAssertNil(TranscriptionClient.endpointURL(from: ""))
XCTAssertNil(TranscriptionClient.endpointURL(from: "example.com"))
}
}