diff options
| author | Stephen Blott | 2012-11-11 15:59:27 +0000 |
|---|---|---|
| committer | Stephen Blott | 2012-11-11 15:59:27 +0000 |
| commit | 2071873f5c9f496e4fde94d44cbf8b0e50bf4c21 (patch) | |
| tree | a3e37e4adc1f41a02ce27ca5c791a3d98c54829b | |
| parent | 03823f97a526ed5e5104b724d4f2a0b582505a6c (diff) | |
| download | vimium-2071873f5c9f496e4fde94d44cbf8b0e50bf4c21.tar.bz2 | |
Remove comments regarding non-existent bug.
| -rw-r--r-- | background_scripts/completion.coffee | 2 | ||||
| -rw-r--r-- | tests/unit_tests/completion_test.coffee | 9 |
2 files changed, 2 insertions, 9 deletions
diff --git a/background_scripts/completion.coffee b/background_scripts/completion.coffee index 91f79338..c12c6d80 100644 --- a/background_scripts/completion.coffee +++ b/background_scripts/completion.coffee @@ -415,8 +415,6 @@ HistoryCache = else toRemove.urls.forEach (url) => i = HistoryCache.binarySearch({url:url}, @history, @compareHistoryByUrl) - # TODO (smblott) - # The `i < @history.length` condition below should not be necessary. It can be removed when `binarySearch` is fixed. if i < @history.length and @history[i].url == url @history.splice(i, 1) diff --git a/tests/unit_tests/completion_test.coffee b/tests/unit_tests/completion_test.coffee index 5d7be78b..f0fc9ded 100644 --- a/tests/unit_tests/completion_test.coffee +++ b/tests/unit_tests/completion_test.coffee @@ -41,13 +41,8 @@ context "HistoryCache", should "return length - 1 if it should be at the end of the list", -> assert.equal 0, HistoryCache.binarySearch(3, [3, 5, 8], @compare) - # FIXME (smblott) - # The following should pass, but fails. - # I think it's what the test above intends (but misses because of a typo). - # Bottom line: binarySearch can currently return an index beyond the end of the array. - # - # should "return end of list if greater than last element in list", -> - # assert.equal 2, HistoryCache.binarySearch(10, [3, 5, 8], @compare) + should "return one passed end of list (so: list.length) if greater than last element in list", -> + assert.equal 3, HistoryCache.binarySearch(10, [3, 5, 8], @compare) should "found return the position if it's between two elements", -> assert.equal 1, HistoryCache.binarySearch(4, [3, 5, 8], @compare) |
