Adds another unit test

This commit is contained in:
Robby 2017-08-06 23:40:06 -05:00
parent 4312777508
commit d76940dabc

View file

@ -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')