mirror of
https://github.com/atom/atom.git
synced 2026-02-14 08:35:11 -05:00
Add specs for moveSelectionRight()
This commit is contained in:
@@ -3457,6 +3457,36 @@ describe "TextEditor", ->
|
||||
expect(selections[1].getText()).toBe 'sort'
|
||||
expect(editor.getSelectedBufferRanges()).toEqual [[[0, 3], [0, 12]], [[1, 5], [1, 9]]]
|
||||
|
||||
describe ".moveSelectionRight()", ->
|
||||
it "moves one active selection on one line one column to the right", ->
|
||||
editor.setSelectedBufferRange [[0, 4], [0, 13]]
|
||||
expect(editor.getSelectedText()).toBe 'quicksort'
|
||||
editor.moveSelectionRight()
|
||||
expect(editor.getSelectedText()).toBe 'quicksort'
|
||||
expect(editor.getSelectedBufferRange()).toEqual [[0, 5], [0, 14]]
|
||||
|
||||
it "moves multiple active selections on one line one column to the right", ->
|
||||
editor.setSelectedBufferRanges([[[0, 4], [0, 13]], [[0, 16], [0, 24]]])
|
||||
selections = editor.getSelections()
|
||||
|
||||
expect(selections[0].getText()).toBe 'quicksort'
|
||||
expect(selections[1].getText()).toBe 'function'
|
||||
editor.moveSelectionRight()
|
||||
expect(selections[0].getText()).toBe 'quicksort'
|
||||
expect(selections[1].getText()).toBe 'function'
|
||||
expect(editor.getSelectedBufferRanges()).toEqual [[[0, 5], [0, 14]], [[0, 17], [0, 25]]]
|
||||
|
||||
it "moves multiple active selections on multiple lines one column to the right", ->
|
||||
editor.setSelectedBufferRanges([[[0, 4], [0, 13]], [[1, 6], [1, 10]]])
|
||||
selections = editor.getSelections()
|
||||
|
||||
expect(selections[0].getText()).toBe 'quicksort'
|
||||
expect(selections[1].getText()).toBe 'sort'
|
||||
editor.moveSelectionRight()
|
||||
expect(selections[0].getText()).toBe 'quicksort'
|
||||
expect(selections[1].getText()).toBe 'sort'
|
||||
expect(editor.getSelectedBufferRanges()).toEqual [[[0, 5], [0, 14]], [[1, 7], [1, 11]]]
|
||||
|
||||
describe 'reading text', ->
|
||||
it '.lineTextForScreenRow(row)', ->
|
||||
editor.foldBufferRow(4)
|
||||
|
||||
Reference in New Issue
Block a user