mirror of
https://github.com/atom/atom.git
synced 2026-01-24 06:18:03 -05:00
Remove specs that don't matter anymore w/ linewise folding
This commit is contained in:
@@ -327,107 +327,6 @@ describe "Renderer", ->
|
||||
expect(line4.screenDelta).toEqual [1, 0]
|
||||
expect(line5.text).toMatch /9-+/
|
||||
|
||||
describe "when a fold begins on the line on which another fold ends", ->
|
||||
describe "when the second fold is created before the first fold", ->
|
||||
it "renders a placeholder for both folds on the first line of the first fold", ->
|
||||
fold1 = renderer.createFold([[7, 5], [8, 36]])
|
||||
fold2 = renderer.createFold([[4, 29], [7, 4]])
|
||||
|
||||
[line4, line5] = renderer.linesForRows(4, 5)
|
||||
expect(line4.text).toBe ' while(items.length > 0) {...}...concat(sort(right));'
|
||||
expect(line5.text).toBe ' };'
|
||||
|
||||
expect(changeHandler.callCount).toBe 2
|
||||
[[event1], [event2]] = changeHandler.argsForCall
|
||||
expect(event1.oldRange).toEqual [[7, 0], [8, 56]]
|
||||
expect(event1.newRange).toEqual [[7, 0], [7, 28]]
|
||||
expect(event2.oldRange).toEqual [[4, 0], [7, 28]]
|
||||
expect(event2.newRange).toEqual [[4, 0], [4, 56]]
|
||||
changeHandler.reset()
|
||||
|
||||
fold1.destroy()
|
||||
[line4, line5] = renderer.linesForRows(4, 5)
|
||||
expect(line4.text).toBe ' while(items.length > 0) {...}'
|
||||
expect(line5.text).toBe ' return sort(left).concat(pivot).concat(sort(right));'
|
||||
|
||||
expect(changeHandler).toHaveBeenCalled()
|
||||
[event] = changeHandler.argsForCall[0]
|
||||
expect(event.oldRange).toEqual [[4, 0], [4, 56]]
|
||||
expect(event.newRange).toEqual [[4, 0], [5, 56]]
|
||||
changeHandler.reset()
|
||||
|
||||
fold2.destroy()
|
||||
[line4, line5] = renderer.linesForRows(4, 5)
|
||||
expect(line4.text).toBe ' while(items.length > 0) {'
|
||||
expect(line5.text).toBe ' current = items.shift();'
|
||||
|
||||
expect(changeHandler).toHaveBeenCalled()
|
||||
[event] = changeHandler.argsForCall[0]
|
||||
expect(event.oldRange).toEqual [[4, 0], [4, 33]]
|
||||
expect(event.newRange).toEqual [[4, 0], [7, 5]]
|
||||
|
||||
describe "when the second fold is created after the first fold", ->
|
||||
it "renders a placeholder for both folds on the first line of the first fold", ->
|
||||
fold1 = renderer.createFold([[4, 29], [7, 4]])
|
||||
fold2 = renderer.createFold([[7, 5], [8, 36]])
|
||||
[line4, line5] = renderer.linesForRows(4, 5)
|
||||
expect(line4.text).toBe ' while(items.length > 0) {...}...concat(sort(right));'
|
||||
expect(line5.text).toBe ' };'
|
||||
|
||||
expect(changeHandler.callCount).toBe 2
|
||||
[[event1], [event2]] = changeHandler.argsForCall
|
||||
expect(event1.oldRange).toEqual [[4, 0], [7, 5]]
|
||||
expect(event1.newRange).toEqual [[4, 0], [4, 33]]
|
||||
expect(event2.oldRange).toEqual [[4, 0], [5, 56]]
|
||||
expect(event2.newRange).toEqual [[4, 0], [4, 56]]
|
||||
changeHandler.reset()
|
||||
|
||||
fold1.destroy()
|
||||
[line4, line5] = renderer.linesForRows(4, 5)
|
||||
[line7] = renderer.linesForRows(7, 7)
|
||||
expect(line4.text).toBe ' while(items.length > 0) {'
|
||||
expect(line5.text).toBe ' current = items.shift();'
|
||||
expect(line7.text).toBe ' }...concat(sort(right));'
|
||||
|
||||
expect(changeHandler).toHaveBeenCalled()
|
||||
[event] = changeHandler.argsForCall[0]
|
||||
expect(event.oldRange).toEqual [[4, 0], [4, 56]]
|
||||
expect(event.newRange).toEqual [[4, 0], [7, 28]]
|
||||
changeHandler.reset()
|
||||
|
||||
fold2.destroy()
|
||||
[line4, line5] = renderer.linesForRows(4, 5)
|
||||
expect(line4.text).toBe ' while(items.length > 0) {'
|
||||
expect(line5.text).toBe ' current = items.shift();'
|
||||
|
||||
expect(changeHandler).toHaveBeenCalled()
|
||||
[event] = changeHandler.argsForCall[0]
|
||||
expect(event.oldRange).toEqual [[7, 0], [7, 28]]
|
||||
expect(event.newRange).toEqual [[7, 0], [8, 56]]
|
||||
|
||||
describe "when a fold starts at the beginning of a line", ->
|
||||
it "renders a placeholder at the beginning of the line", ->
|
||||
renderer.createFold([[4, 0], [7, 4]])
|
||||
expect(renderer.lineForRow(4).text).toBe '...}'
|
||||
|
||||
describe "when a fold ends at the beginning of a line", ->
|
||||
it "renders a placeholder at the beginning of the line", ->
|
||||
renderer.createFold([[4, 29], [7, 0]])
|
||||
expect(renderer.lineForRow(4).text).toBe ' while(items.length > 0) {... }'
|
||||
|
||||
describe "when a fold starts on the first line of the buffer", ->
|
||||
it "renders the first line correctly when the fold is destroyed", ->
|
||||
fold = renderer.createFold([[0, 14], [0, 27]])
|
||||
fold.destroy()
|
||||
expect(renderer.lineForRow(0).text).toBe 'var quicksort = function () {'
|
||||
|
||||
describe "when a fold causes a wrapped line to become shorter than the max line length", ->
|
||||
it "unwraps the line", ->
|
||||
renderer.setMaxLineLength(50)
|
||||
renderer.createFold([[3, 0], [3, 15]])
|
||||
expect(renderer.lineForRow(3).text).toBe '... items.shift(), current, left = [], right = [];'
|
||||
expect(renderer.lineForRow(4).text).toBe ' while(items.length > 0) {'
|
||||
|
||||
describe "when the buffer changes", ->
|
||||
[fold1, fold2] = []
|
||||
beforeEach ->
|
||||
|
||||
Reference in New Issue
Block a user