chore: Sprachmittler OpenCode starter kit
This commit is contained in:
commit
374085ec2f
94 files changed
+4563
No files matched your search
@@ -0,0 +1 @@
|
||||
Größenänderungen und Straßen sind wichtig. Die Übersetzung muss Umlaute, ß und Zahlen wie 1,5 korrekt erhalten.
|
||||
@@ -0,0 +1 @@
|
||||
The quick brown fox jumps over the lazy dog. Please open https://example.com/docs?lang=en and set the limit to {{limit}} before you continue.
|
||||
@@ -0,0 +1,3 @@
|
||||
# Release notes
|
||||
|
||||
Open **Settings** and set `max_tokens` to {{limit}}. See [the docs](https://example.com/docs).
|
||||
@@ -0,0 +1 @@
|
||||
Hello {{name}}, your code is ${code}. Use %s or %d. Contact support@example.com or visit https://example.com/help?x=1.
|
||||
@@ -0,0 +1,37 @@
|
||||
import Foundation
|
||||
import Testing
|
||||
@testable import SprachmittlerText
|
||||
|
||||
@Test func moduleLinks() {
|
||||
#expect(SprachmittlerTextModule.moduleName == "SprachmittlerText")
|
||||
}
|
||||
|
||||
/// T0.1: the synthetic text fixtures are bundled and readable through Bundle.module.
|
||||
@Test(arguments: [
|
||||
"en-sample.txt", "de-sample.txt", "markdown-sample.md", "placeholders.txt",
|
||||
])
|
||||
func fixtureIsBundled(name: String) throws {
|
||||
let url = try fixtureURL("Fixtures/\(name)")
|
||||
let data = try Data(contentsOf: url)
|
||||
#expect(!data.isEmpty)
|
||||
}
|
||||
|
||||
@Test func englishFixtureHasAURLAndAPlaceholder() throws {
|
||||
let text = try String(contentsOf: fixtureURL("Fixtures/en-sample.txt"), encoding: .utf8)
|
||||
#expect(text.contains("https://example.com"))
|
||||
#expect(text.contains("{{limit}}"))
|
||||
}
|
||||
|
||||
@Test func germanFixtureHasUmlautsAndSharingS() throws {
|
||||
let text = try String(contentsOf: fixtureURL("Fixtures/de-sample.txt"), encoding: .utf8)
|
||||
#expect(text.contains("Größe"))
|
||||
#expect(text.contains("Straßen"))
|
||||
}
|
||||
|
||||
/// Resolves a path inside the copied `Fixtures` folder of this test target.
|
||||
private func fixtureURL(_ relativePath: String) throws -> URL {
|
||||
let base = try #require(Bundle.module.resourceURL)
|
||||
let url = base.appendingPathComponent(relativePath)
|
||||
try #require(FileManager.default.fileExists(atPath: url.path))
|
||||
return url
|
||||
}
|
||||
Reference in new issue
Block a user