fix iOS build blockers and add project scaffold

This commit is contained in:
2026-04-09 20:04:24 +02:00
parent 02278ddac7
commit da1947da09
18 changed files with 492 additions and 55 deletions
@@ -0,0 +1,38 @@
import XCTest
@testable import HermesApp
private struct TestFailure: Error, CustomStringConvertible {
let description: String
}
@MainActor
final class LocalizationStoreTests: XCTestCase {
func testEnglishBundleStringsLoad() throws {
let store = LocalizationStore(localeCode: "en")
try expectEqual(store.string(for: "app.name"), "Hermes")
try expectEqual(store.string(for: "settings.title"), "Settings")
try expectEqual(store.string(for: "settings.enabled"), "Enabled")
}
func testSwedishBundleStringsLoad() throws {
let store = LocalizationStore(localeCode: "sv")
try expectEqual(store.string(for: "app.name"), "Hermes")
try expectEqual(store.string(for: "settings.title"), "Inställningar")
try expectEqual(store.string(for: "settings.enabled"), "Aktiverad")
}
func testUnsupportedLocaleFallsBackToEnglish() throws {
let store = LocalizationStore(localeCode: "fr")
try expectEqual(store.string(for: "settings.analytics"), "Analytics")
try expectEqual(store.localeName(for: "sv", displayLocaleCode: "fr"), "Swedish")
}
private func expectEqual(_ actual: String, _ expected: String) throws {
guard actual == expected else {
throw TestFailure(description: "Expected \(expected), got \(actual)")
}
}
}