Adds another unit test
This commit is contained in:
parent
4312777508
commit
d76940dabc
1 changed files with 8 additions and 3 deletions
|
|
@ -984,12 +984,17 @@ describe "the commands", ->
|
|||
expect(calls[0].args[0].range).toEqual [0, 2]
|
||||
expect(calls[1].args[0].range).toEqual [3, 3]
|
||||
|
||||
desctibe ':sort', ->
|
||||
describe ':sort', ->
|
||||
beforeEach ->
|
||||
editor.setText('ghi\nabc\njkl\ndef\n')
|
||||
editor.setText('ghi\nabc\njkl\ndef\n142\nzzz\n91xfds9\n')
|
||||
editor.setCursorBufferPosition([0, 0])
|
||||
|
||||
it "sorts entire file if range is not multi-line", ->
|
||||
openEx()
|
||||
submitNormalModeInputText('sort')
|
||||
expect(atom.getText()).toEqual('abc\ndef\nghi\njkl\n')
|
||||
expect(editor.getText()).toEqual('142\n91xfds9\nabc\ndef\nghi\njkl\nzzz\n')
|
||||
|
||||
it "sorts specific range if range is multi-line", ->
|
||||
openEx()
|
||||
submitNormalModeInputText('2,4sort')
|
||||
expect(editor.getText()).toEqual('ghi\nabc\ndef\njkl\n142\nzzz\n91xfds9\n')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue