🎨 Improve test descriptions and fix a typo

This commit is contained in:
abe33
2015-10-12 22:10:09 +02:00
parent 45a3dbca4e
commit d8aba0d295

View File

@@ -1976,7 +1976,7 @@ describe "TextEditor", ->
expect(editor.lineTextForBufferRow(7)).toBe " var pivot = items.shift(), current, left = [], right = [];"
describe "when the slecetion spans multiple lines", ->
describe "when the selection spans multiple lines", ->
it "moves the lines spanned by the selection to the following row", ->
expect(editor.lineTextForBufferRow(2)).toBe " if (items.length <= 1) return items;"
expect(editor.lineTextForBufferRow(3)).toBe " var pivot = items.shift(), current, left = [], right = [];"
@@ -2044,8 +2044,8 @@ describe "TextEditor", ->
expect(editor.lineTextForBufferRow(5)).toBe " current < pivot ? left.push(current) : right.push(current);"
expect(editor.lineTextForBufferRow(6)).toBe " current = items.shift();"
describe "when there is a fold", ->
it "moves all lines that spanned by a selection to preceding row, preserving all folds", ->
describe "when there is a fold below one of the selected row", ->
it "moves all lines spanned by a selection to the following row, preserving the fold", ->
editor.createFold(4, 7)
expect(editor.isFoldedAtBufferRow(4)).toBeTruthy()
@@ -2067,28 +2067,28 @@ describe "TextEditor", ->
expect(editor.lineTextForBufferRow(7)).toBe " var pivot = items.shift(), current, left = [], right = [];"
expect(editor.lineTextForBufferRow(9)).toBe " return sort(left).concat(pivot).concat(sort(right));"
describe "and the multiple selections spans the two line before it", ->
it "moves all the lines, preserving the fold", ->
editor.createFold(4, 7)
describe "when there is a fold below a group of multiple selections without any lines with no selection in-between", ->
it "moves all the lines below the fold, preserving the fold", ->
editor.createFold(4, 7)
expect(editor.isFoldedAtBufferRow(4)).toBeTruthy()
expect(editor.isFoldedAtBufferRow(5)).toBeTruthy()
expect(editor.isFoldedAtBufferRow(6)).toBeTruthy()
expect(editor.isFoldedAtBufferRow(7)).toBeTruthy()
expect(editor.isFoldedAtBufferRow(8)).toBeFalsy()
expect(editor.isFoldedAtBufferRow(4)).toBeTruthy()
expect(editor.isFoldedAtBufferRow(5)).toBeTruthy()
expect(editor.isFoldedAtBufferRow(6)).toBeTruthy()
expect(editor.isFoldedAtBufferRow(7)).toBeTruthy()
expect(editor.isFoldedAtBufferRow(8)).toBeFalsy()
editor.setSelectedBufferRanges([[[2, 2], [2, 6]], [[3, 0], [3, 4]]])
editor.moveLineDown()
editor.setSelectedBufferRanges([[[2, 2], [2, 6]], [[3, 0], [3, 4]]])
editor.moveLineDown()
expect(editor.getSelectedBufferRanges()).toEqual [[[7, 0], [7, 4]], [[6, 2], [6, 6]]]
expect(editor.lineTextForBufferRow(2)).toBe " while(items.length > 0) {"
expect(editor.isFoldedAtBufferRow(2)).toBeTruthy()
expect(editor.isFoldedAtBufferRow(3)).toBeTruthy()
expect(editor.isFoldedAtBufferRow(4)).toBeTruthy()
expect(editor.isFoldedAtBufferRow(5)).toBeTruthy()
expect(editor.isFoldedAtBufferRow(6)).toBeFalsy()
expect(editor.lineTextForBufferRow(6)).toBe " if (items.length <= 1) return items;"
expect(editor.lineTextForBufferRow(7)).toBe " var pivot = items.shift(), current, left = [], right = [];"
expect(editor.getSelectedBufferRanges()).toEqual [[[7, 0], [7, 4]], [[6, 2], [6, 6]]]
expect(editor.lineTextForBufferRow(2)).toBe " while(items.length > 0) {"
expect(editor.isFoldedAtBufferRow(2)).toBeTruthy()
expect(editor.isFoldedAtBufferRow(3)).toBeTruthy()
expect(editor.isFoldedAtBufferRow(4)).toBeTruthy()
expect(editor.isFoldedAtBufferRow(5)).toBeTruthy()
expect(editor.isFoldedAtBufferRow(6)).toBeFalsy()
expect(editor.lineTextForBufferRow(6)).toBe " if (items.length <= 1) return items;"
expect(editor.lineTextForBufferRow(7)).toBe " var pivot = items.shift(), current, left = [], right = [];"
describe "when some of the selections span the same lines", ->
it "moves lines that contain multiple selections correctly", ->