Write specs for atomic tokens

This commit is contained in:
Antonio Scandurra
2015-03-13 11:56:00 +01:00
parent 02ad2e8ff7
commit c319b80464

View File

@@ -1635,6 +1635,19 @@ describe "TextEditor", ->
[[7, 20], [7, 25]]
]
it "takes atomic tokens into account", ->
waitsForPromise ->
atom.project.open('sample-with-tabs-and-leading-comment.coffee', autoIndent: false).then (o) -> editor = o
runs ->
editor.setSelectedBufferRange([[2, 1], [2, 3]])
editor.addSelectionBelow()
expect(editor.getSelectedBufferRanges()).toEqual [
[[2, 1], [2, 3]]
[[3, 1], [3, 2]]
]
describe "when the selection is empty", ->
it "does not skip soft-wrapped lines shorter than the current column", ->
editor.setSoftWrapped(true)
@@ -1723,6 +1736,19 @@ describe "TextEditor", ->
[[6, 20], [6, 25]]
]
it "takes atomic tokens into account", ->
waitsForPromise ->
atom.project.open('sample-with-tabs-and-leading-comment.coffee', autoIndent: false).then (o) -> editor = o
runs ->
editor.setSelectedBufferRange([[3, 1], [3, 2]])
editor.addSelectionAbove()
expect(editor.getSelectedBufferRanges()).toEqual [
[[3, 1], [3, 2]]
[[2, 1], [2, 3]]
]
describe "when the selection is empty", ->
it "does not skip soft-wrapped lines shorter than the current column", ->
editor.setSoftWrapped(true)