diff options
| -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)  | 
