Permalink
Browse files

Remove comments regarding non-existent bug.

  • Loading branch information...
1 parent 03823f9 commit 2071873f5c9f496e4fde94d44cbf8b0e50bf4c21 @smblott-github smblott-github committed Nov 11, 2012
Showing with 2 additions and 9 deletions.
  1. +0 −2 background_scripts/completion.coffee
  2. +2 −7 tests/unit_tests/completion_test.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)
@@ -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)

0 comments on commit 2071873

Please sign in to comment.