Skip to content

Commit

Permalink
Fixes the tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
zonble committed Nov 5, 2024
1 parent 8428bd1 commit 4b16bfa
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions McBopomofoTests/AssociatedPhrasesTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,18 @@ import XCTest
class AssociatedPhrasesTests: XCTestCase {

var handler = KeyHandler()
var chineseConversionEnabled: Bool = false

override func setUpWithError() throws {
chineseConversionEnabled = Preferences.chineseConversionEnabled
Preferences.chineseConversionEnabled = false
LanguageModelManager.loadDataModels()
handler = KeyHandler()
handler.inputMode = .bopomofo
}

override func tearDownWithError() throws {
Preferences.chineseConversionEnabled = chineseConversionEnabled
}

func testBuildingAssociatedPhrasesState() {
Expand Down
3 changes: 3 additions & 0 deletions McBopomofoTests/KeyHandlerBopomofoTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,18 @@ func charCode(_ string: String) -> UInt16 {

class KeyHandlerBopomofoTests: XCTestCase {
var handler = KeyHandler()
var chineseConversionEnabled: Bool = false

override func setUpWithError() throws {
chineseConversionEnabled = Preferences.chineseConversionEnabled
Preferences.chineseConversionEnabled = false
LanguageModelManager.loadDataModels()
handler = KeyHandler()
handler.inputMode = .bopomofo
}

override func tearDownWithError() throws {
Preferences.chineseConversionEnabled = chineseConversionEnabled
}

func testSyncWithPreferences() {
Expand Down
2 changes: 0 additions & 2 deletions McBopomofoTests/ServiceProviderTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,4 @@ final class ServiceProviderTests: XCTestCase {
let result = provider.convertToBraille(string: "24")
XCTAssert(result == "⠼⠆⠲", result)
}


}

0 comments on commit 4b16bfa

Please sign in to comment.