mirror of
https://github.com/magnars/multiple-cursors.el.git
synced 2026-02-04 14:22:24 +00:00
Update test.
This commit is contained in:
@@ -5,8 +5,9 @@ Feature: Multiple cursors core
|
|||||||
|
|
||||||
Scenario: Two cursors
|
Scenario: Two cursors
|
||||||
Given there is no region selected
|
Given there is no region selected
|
||||||
When I insert "This text contains the word text twice"
|
When I insert "This text contains the word text thrice (text)"
|
||||||
And I select "text"
|
And I select "text"
|
||||||
And I press "C->"
|
And I press "C->"
|
||||||
|
And I press "C->"
|
||||||
And I press "C-g"
|
And I press "C-g"
|
||||||
Then I should have 2 cursors
|
Then I should have 3 cursors
|
||||||
|
|||||||
@@ -3,13 +3,14 @@
|
|||||||
(delete-selection-mode 1)))
|
(delete-selection-mode 1)))
|
||||||
|
|
||||||
(defun is-extra-cursor-p (o)
|
(defun is-extra-cursor-p (o)
|
||||||
|
(message "overlay-type: %S" (overlay-get o 'type))
|
||||||
(eq (overlay-get o 'type) 'additional-cursor))
|
(eq (overlay-get o 'type) 'additional-cursor))
|
||||||
|
|
||||||
(defun num-cursors ()
|
(defun num-cursors ()
|
||||||
(1+ (count-if 'is-extra-cursor-p
|
(1+ (count-if 'is-extra-cursor-p
|
||||||
(overlays-in (point-min) (point-max)))))
|
(overlays-in (point-min) (point-max)))))
|
||||||
|
|
||||||
(Then "^I should have 2 cursors$"
|
(Then "^I should have \\([0-9]+\\) cursors$"
|
||||||
(lambda ()
|
(lambda (num)
|
||||||
(assert (eq 2 (num-cursors)) nil
|
(assert (eq (string-to-number num) (num-cursors)) nil
|
||||||
"Expected to have 2 cursors, but was %d." (num-cursors))))
|
"Expected to have %s cursors, but was %d." num (num-cursors))))
|
||||||
|
|||||||
Submodule util/ecukes updated: 4b30d7dd4c...2e8898df9a
Reference in New Issue
Block a user