diff --git a/spec/swap-selection-spec.coffee b/spec/swap-selection-spec.coffee index e29976c..1587256 100644 --- a/spec/swap-selection-spec.coffee +++ b/spec/swap-selection-spec.coffee @@ -32,3 +32,14 @@ describe "SwapSelection", -> swapSelection -> expect(editor.getText()).toBe 'one two three' + + it "does it all in one transaction", -> + expected = 'two one three' + + editor.setText expected + # selecting "one" "two" + editor.setSelectedBufferRanges([[[0, 0], [0, 3]], [[0, 4], [0, 7]]]) + + swapSelection -> + editor.undo() + expect(editor.getText()).toBe expected