diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/completion_test.coffee | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/completion_test.coffee b/tests/completion_test.coffee index ed864151..218225d4 100644 --- a/tests/completion_test.coffee +++ b/tests/completion_test.coffee @@ -19,8 +19,8 @@ context "bookmark completer", should "return matching bookmarks when searching", -> @completer.refresh() - @completer.filter(["mark2"], (@results) =>) - assert.arrayEqual [@bookmark2.url], @results.map (suggestion) -> suggestion.url + results = filterCompleter(@completer, ["mark2"]) + assert.arrayEqual [@bookmark2.url], results.map (suggestion) -> suggestion.url context "HistoryCache", context "binary search", @@ -138,6 +138,11 @@ context "suggestions", suggestion = new Suggestion(["queryterm"], "tab", "http://ninjawords.com", "ninjawords", returns(1)) assert.equal -1, suggestion.generateHtml().indexOf("http://ninjawords.com") +context "RankingUtils", + should "do a case insensitive match", -> + assert.isTrue RankingUtils.matches(["maRiO"], "MARIO", "MARIo") + + # A convenience wrapper around completer.filter() so it can be called synchronously in tests. filterCompleter = (completer, queryTerms) -> results = [] |
