aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPhil Crosby2012-06-10 00:27:11 -0700
committerPhil Crosby2012-06-10 01:41:45 -0700
commit65c6dd4ccf94660697acfd073ea6e4b714c4eb4f (patch)
treee4664e1c00191b898c65098be1474281e591ccd6 /tests
parent5477566fce3e979f482d84c5b1e78594fd4e49a7 (diff)
downloadvimium-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.coffee9
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 = []