Modifies sort function and adds a unit test

This commit is contained in:
Robby 2017-08-06 23:22:13 -05:00
parent 15296ff369
commit 4312777508
2 changed files with 23 additions and 4 deletions

View file

@ -983,3 +983,13 @@ describe "the commands", ->
expect(calls.length).toEqual 2
expect(calls[0].args[0].range).toEqual [0, 2]
expect(calls[1].args[0].range).toEqual [3, 3]
desctibe ':sort', ->
beforeEach ->
editor.setText('ghi\nabc\njkl\ndef\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')