diff options
| author | Phil Crosby | 2012-06-10 00:27:11 -0700 |
|---|---|---|
| committer | Phil Crosby | 2012-06-10 01:41:45 -0700 |
| commit | 65c6dd4ccf94660697acfd073ea6e4b714c4eb4f (patch) | |
| tree | e4664e1c00191b898c65098be1474281e591ccd6 /tests | |
| parent | 5477566fce3e979f482d84c5b1e78594fd4e49a7 (diff) | |
| download | vimium-65c6dd4ccf94660697acfd073ea6e4b714c4eb4f.tar.bz2 | |
Ensure matches are case insensitive, and cache regexp's so they're not created excessively.
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 = [] |
