mirror of
https://github.com/magnars/multiple-cursors.el.git
synced 2026-02-04 14:22:24 +00:00
Finally got the tests running. :-)
This commit is contained in:
@@ -1,16 +1,27 @@
|
||||
(And "^delete-selection-mode is active$"
|
||||
(lambda ()
|
||||
(delete-selection-mode 1)))
|
||||
(delete-selection-mode 1)))
|
||||
|
||||
(defun is-extra-cursor-p (o)
|
||||
(message "overlay-type: %S" (overlay-get o 'type))
|
||||
(eq (overlay-get o 'type) 'additional-cursor))
|
||||
|
||||
(defun num-cursors ()
|
||||
(1+ (count-if 'is-extra-cursor-p
|
||||
(overlays-in (point-min) (point-max)))))
|
||||
(overlays-in (point-min) (point-max)))))
|
||||
|
||||
(Then "^I should have \\([0-9]+\\) cursors$"
|
||||
(lambda (num)
|
||||
(assert (eq (string-to-number num) (num-cursors)) nil
|
||||
"Expected to have %s cursors, but was %d." num (num-cursors))))
|
||||
(lambda (num)
|
||||
(let ((actual (num-cursors)))
|
||||
(assert (eq (string-to-number num) actual) nil
|
||||
"Expected to have %s cursors, but was %d." num actual))))
|
||||
|
||||
(Then "^I should have one cursor$"
|
||||
(lambda ()
|
||||
(assert (not multiple-cursors-mode) nil
|
||||
"Expected to have one cursor, but multiple-cursors-mode is still active.")
|
||||
(assert (eq 1 (num-cursors)) nil
|
||||
"Expected to have one cursor, but there are still fake cursor overlays.")))
|
||||
|
||||
(And "^I switch to multiple-cursors mode$"
|
||||
(lambda ()
|
||||
(mc/switch-from-mark-multiple-to-cursors)))
|
||||
|
||||
Reference in New Issue
Block a user