mirror of
https://github.com/atom/atom.git
synced 2026-01-23 22:08:08 -05:00
Add specs for variation sequences
This commit is contained in:
@@ -3343,7 +3343,7 @@ describe "Editor", ->
|
||||
editor2.destroy()
|
||||
expect(editor.shouldPromptToSave()).toBeTruthy()
|
||||
|
||||
describe "when the edit session contains surrogate pair characters", ->
|
||||
describe "when the editor text contains surrogate pair characters", ->
|
||||
it "correctly backspaces over them", ->
|
||||
editor.setText('\uD835\uDF97\uD835\uDF97\uD835\uDF97')
|
||||
editor.moveToBottom()
|
||||
@@ -3384,6 +3384,47 @@ describe "Editor", ->
|
||||
editor.moveLeft()
|
||||
expect(editor.getCursorBufferPosition()).toEqual [0, 0]
|
||||
|
||||
describe "when the editor contains variation sequence character pairs", ->
|
||||
it "correctly backspaces over them", ->
|
||||
editor.setText('\u2714\uFE0E\u2714\uFE0E\u2714\uFE0E')
|
||||
editor.moveToBottom()
|
||||
editor.backspace()
|
||||
expect(editor.getText()).toBe '\u2714\uFE0E\u2714\uFE0E'
|
||||
editor.backspace()
|
||||
expect(editor.getText()).toBe '\u2714\uFE0E'
|
||||
editor.backspace()
|
||||
expect(editor.getText()).toBe ''
|
||||
|
||||
it "correctly deletes over them", ->
|
||||
editor.setText('\u2714\uFE0E\u2714\uFE0E\u2714\uFE0E')
|
||||
editor.moveToTop()
|
||||
editor.delete()
|
||||
expect(editor.getText()).toBe '\u2714\uFE0E\u2714\uFE0E'
|
||||
editor.delete()
|
||||
expect(editor.getText()).toBe '\u2714\uFE0E'
|
||||
editor.delete()
|
||||
expect(editor.getText()).toBe ''
|
||||
|
||||
it "correctly moves over them", ->
|
||||
editor.setText('\u2714\uFE0E\u2714\uFE0E\u2714\uFE0E\n')
|
||||
editor.moveToTop()
|
||||
editor.moveRight()
|
||||
expect(editor.getCursorBufferPosition()).toEqual [0, 2]
|
||||
editor.moveRight()
|
||||
expect(editor.getCursorBufferPosition()).toEqual [0, 4]
|
||||
editor.moveRight()
|
||||
expect(editor.getCursorBufferPosition()).toEqual [0, 6]
|
||||
editor.moveRight()
|
||||
expect(editor.getCursorBufferPosition()).toEqual [1, 0]
|
||||
editor.moveLeft()
|
||||
expect(editor.getCursorBufferPosition()).toEqual [0, 6]
|
||||
editor.moveLeft()
|
||||
expect(editor.getCursorBufferPosition()).toEqual [0, 4]
|
||||
editor.moveLeft()
|
||||
expect(editor.getCursorBufferPosition()).toEqual [0, 2]
|
||||
editor.moveLeft()
|
||||
expect(editor.getCursorBufferPosition()).toEqual [0, 0]
|
||||
|
||||
describe ".setIndentationForBufferRow", ->
|
||||
describe "when the editor uses soft tabs but the row has hard tabs", ->
|
||||
it "only replaces whitespace characters", ->
|
||||
|
||||
Reference in New Issue
Block a user