Add regression test for command preview corpus
This commit is contained in:
parent
23910dea9a
commit
fdf2212c88
2 changed files with 55 additions and 0 deletions
|
|
@ -3434,6 +3434,25 @@ struct ContentView: View {
|
|||
return Array(matches.prefix(resultLimit))
|
||||
}
|
||||
|
||||
nonisolated static func commandPaletteCommandPreviewMatchCommandIDsForTests(
|
||||
searchCorpus: [CommandPaletteSearchCorpusEntry<String>],
|
||||
candidateCommandIDs: [String],
|
||||
searchCorpusByID: [String: CommandPaletteSearchCorpusEntry<String>],
|
||||
query: String,
|
||||
resultLimit: Int
|
||||
) -> [String] {
|
||||
let preparedQuery = CommandPaletteFuzzyMatcher.preparedQuery(query)
|
||||
return commandPalettePreviewSearchMatches(
|
||||
candidateCommandIDs: candidateCommandIDs,
|
||||
searchCorpusByID: searchCorpusByID,
|
||||
query: query,
|
||||
usageHistory: [:],
|
||||
queryIsEmpty: preparedQuery.isEmpty,
|
||||
historyTimestamp: 0,
|
||||
resultLimit: resultLimit
|
||||
).map(\.commandID)
|
||||
}
|
||||
|
||||
private func scheduleCommandPaletteResultsRefresh(forceSearchCorpusRefresh: Bool = false) {
|
||||
refreshCommandPaletteSearchCorpus(force: forceSearchCorpusRefresh)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue