Write a regression test
MODIFY
spec/results-model-spec.coffee
spec/results-model-spec.coffee
@@ -107,6 +107,16 @@ describe 'ResultsModel', ->
advanceClock(editor.buffer.stoppedChangingDelay)
expect(editor.scan).not.toHaveBeenCalled()
+ it "contains valid match objects after destroying a buffer (regression)", ->
+ waitsForPromise ->
+ resultsModel.search('items', '*.js', '')
+
+ runs ->
+ advanceClock(editor.buffer.stoppedChangingDelay)
+ editor.getBuffer().destroy()
+ result = resultsModel.getResult(editor.getPath())
+ expect(result.matches[0].lineText).toBe(" var sort = function(items) {")
+
describe "cancelling a search", ->
cancelledSpy = null
beforeEach ->

Write a regression test