emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/iedit 7ebea0f43b 070/301: Add tests for iedit-rectangle


From: ELPA Syncer
Subject: [nongnu] elpa/iedit 7ebea0f43b 070/301: Add tests for iedit-rectangle
Date: Mon, 10 Jan 2022 22:58:51 -0500 (EST)

branch: elpa/iedit
commit 7ebea0f43b403712abb984edff123579e593c3a7
Author: Victor Ren <victorhge@gmail.com>
Commit: Victor Ren <victorhge@gmail.com>

    Add tests for iedit-rectangle
---
 iedit-tests.el | 40 +++++++++++++++++++++++++++++++++++++++-
 1 file changed, 39 insertions(+), 1 deletion(-)

diff --git a/iedit-tests.el b/iedit-tests.el
index adb02abc4f..d747a79523 100755
--- a/iedit-tests.el
+++ b/iedit-tests.el
@@ -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
@@ -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")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]