Navigation Menu

Skip to content

Commit

Permalink
Add tests for iedit-rectangle
Browse files Browse the repository at this point in the history
  • Loading branch information
victorhge committed Feb 28, 2012
1 parent 1b3672d commit 7ebea0f
Showing 1 changed file with 39 additions and 1 deletion.
40 changes: 39 additions & 1 deletion iedit-tests.el
Expand Up @@ -2,7 +2,7 @@

;; Copyright (C) 2010, 2011, 2012 Victor Ren

;; Time-stamp: <2012-02-28 10:23:08 Victor Ren>
;; Time-stamp: <2012-02-28 12:27:32 Victor Ren>
;; Author: Victor Ren <victorhge@gmail.com>
;; Version: 0.94
;; X-URL: http://www.emacswiki.org/emacs/Iedit
Expand Down Expand Up @@ -250,6 +250,44 @@ foo"
barfoo
barfoo")))))

(ert-deftest iedit-rectangle-start-test ()
(with-iedit-test-fixture
"foo
foo
barfoo
foo"
(lambda ()
(iedit-mode)
(set-mark-command nil)
(forward-char 3)
(forward-line 3)
(iedit-mode)
(should (equal iedit-rectangle nil))
(iedit-mode)
(exchange-point-and-mark)
(iedit-mode 4)
(should (equal iedit-rectangle '(1 19))))))

(ert-deftest iedit-kill-rectangle-test ()
(with-iedit-test-fixture
"foo
foo
barfoo
foo"
(lambda ()
(iedit-mode)
(set-mark-command nil)
(goto-char 22)
(iedit-mode 4)
(should (equal iedit-rectangle '(1 22)))
(iedit-kill-rectangle)
(should (string= (buffer-string)
"
o
arfoo
foo"))
(should (equal killed-rectangle '("foo" " fo" " b" " "))))))

(defvar iedit-printable-test-lists
'(("" "")
("abc" "abc")
Expand Down

0 comments on commit 7ebea0f

Please sign in to comment.