Skip to content

Commit

Permalink
Add binarySearch test
Browse files Browse the repository at this point in the history
  • Loading branch information
Tatsumi0000 committed Apr 18, 2024
1 parent d2d3178 commit b326a90
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,13 @@ struct WordListFileUseCaseTests {
word: wordToFileName.word), sourceLocation: testCase.sourceLocation)
}
}

func binarySearch() {
let useCase = UseCaseProvider.shared.wordListFileUseCase
let wordList = (0...9).map({ "test" + String($0) })
let word = "test2"
let expected = ["test2", "test3"]
let words = useCase.binarySearch(word: word, candidatesSize: 2, wordList: wordList)
#expect(words == expected)
}
}

0 comments on commit b326a90

Please sign in to comment.