[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/iedit 962fcdb6cd 124/301: Fix failed test cases
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/iedit 962fcdb6cd 124/301: Fix failed test cases |
Date: |
Mon, 10 Jan 2022 22:58:56 -0500 (EST) |
branch: elpa/iedit
commit 962fcdb6cdff99371d001bf3c335e8725478c9ab
Author: Victor Ren <victorhge@gmail.com>
Commit: Victor Ren <victorhge@gmail.com>
Fix failed test cases
---
iedit-tests.el | 29 ++++++++++++++++++++++++-----
iedit.el | 27 +++++++++++++++------------
2 files changed, 39 insertions(+), 17 deletions(-)
diff --git a/iedit-tests.el b/iedit-tests.el
index 06d5fc90c1..ab7a54cd12 100644
--- a/iedit-tests.el
+++ b/iedit-tests.el
@@ -2,7 +2,7 @@
;; Copyright (C) 2010, 2011, 2012 Victor Ren
-;; Time-stamp: <2012-08-09 17:17:03 Victor Ren>
+;; Time-stamp: <2012-10-15 16:12:02 Victor Ren>
;; Author: Victor Ren <victorhge@gmail.com>
;; Version: 0.97
;; X-URL: http://www.emacswiki.org/emacs/Iedit
@@ -30,6 +30,7 @@
;;; Code:
(require 'ert)
(require 'iedit)
+(require 'iedit-rect)
(ert-deftest iedit-compile-test ()
(let ((byte-compile-error-on-warn t ))
@@ -128,6 +129,25 @@ foo"
123foo456123foo456
123foo456")))))
+(ert-deftest iedit-overlay-at-end-of-buffer ()
+ (with-iedit-test-fixture
+ "foo
+foo"
+ (lambda ()
+ (iedit-mode)
+ (highlight-changes-mode 1)
+ (goto-char (point-min))
+ (goto-char (point-at-eol))
+ (iedit-mode)
+ (delete-region (point) (1- (point)))
+ (should (string= (buffer-string)
+ "fo
+fo"))
+ (insert "b")
+ (should (string= (buffer-string)
+ "fob
+fob")))))
+
(ert-deftest iedit-mode-start-from-isearch-test ()
(with-iedit-test-fixture
"foo
@@ -143,7 +163,7 @@ foo"
(isearch-process-search-char ?f)
(isearch-process-search-char ?o)
(isearch-process-search-char ?o)
- (iedit-mode)
+ (iedit-mode-from-isearch)
(should (string= iedit-initial-string-local "foo"))
(should (= 4 (length iedit-occurrences-overlays)))
(iedit-mode)
@@ -342,8 +362,7 @@ foo"
(iedit-mode) ; turn off iedit
(goto-char 2)
(set-mark-command nil)
- (forward-char 1)
- (forward-line 1)
+ (goto-char 7)
(iedit-rectangle-mode)
(iedit-blank-occurrences)
(should (string= (buffer-string) "f o
@@ -463,7 +482,7 @@ arfoo
(should (= 1 (length iedit-occurrences-overlays)))
(iedit-mode)
(goto-char 13)
- (iedit-mode-on-function)
+ (iedit-mode-toggle-on-function)
(should (= 4 (length iedit-occurrences-overlays)))
(iedit-mode)
(iedit-mode)
diff --git a/iedit.el b/iedit.el
index 9eea9c81c5..f97afd057e 100644
--- a/iedit.el
+++ b/iedit.el
@@ -2,7 +2,7 @@
;; Copyright (C) 2010, 2011, 2012 Victor Ren
-;; Time-stamp: <2012-09-12 15:22:33 Victor Ren>
+;; Time-stamp: <2012-10-15 15:09:14 Victor Ren>
;; Author: Victor Ren <victorhge@gmail.com>
;; Keywords: occurrence region simultaneous refactoring
;; Version: 0.97
@@ -340,30 +340,32 @@ Keymap used within overlays:
(setq iedit-only-complete-symbol-local complete-symbol)
(setq mark-active nil)
(run-hooks 'deactivate-mark-hook)
+ (setq iedit-initial-string-local occurrence)
(iedit-start (iedit-regexp-quote occurrence) beg end))))
-(defun iedit-mode-from-isearch (regexp)
+(defun iedit-mode-from-isearch ()
"Start Iedit mode using last search string as the regexp."
- (interactive
- (let ((regexp (cond
- ((functionp isearch-word)
- (funcall isearch-word isearch-string))
+ (interactive)
+ (let ((regexp (cond
(isearch-word (word-search-regexp isearch-string))
(isearch-regexp isearch-string)
(t (regexp-quote isearch-string)))))
- (list regexp)))
- (isearch-exit)
- (iedit-start regexp (point-min) (point-max))
+ (if (or isearch-regexp isearch-word)
+ nil
+ (setq iedit-initial-string-local isearch-string))
+ (isearch-exit)
+ (setq mark-active nil)
+ (run-hooks 'deactivate-mark-hook)
+ (iedit-start regexp (point-min) (point-max))
;; TODO: reconsider how to avoid the loop in iedit-same-length
- (if (iedit-same-length)
+ (if (iedit-same-length)
nil
(iedit-done)
- (message "Matches are not the same length.")))
+ (message "Matches are not the same length."))))
(defun iedit-start (occurrence-regexp beg end)
"Start Iedit mode for the `occurrence-regexp' in the current buffer."
(setq iedit-unmatched-lines-invisible
iedit-unmatched-lines-invisible-default)
- (setq iedit-initial-string-local occurrence-regexp)
(setq iedit-initial-region (list beg end))
(iedit-start2 occurrence-regexp beg end)
(run-hooks 'iedit-mode-hook)
@@ -401,6 +403,7 @@ the initial string globally."
(iedit-cleanup)
+ (setq iedit-initial-string-local nil)
(setq iedit-mode nil)
(force-mode-line-update)
(remove-hook 'kbd-macro-termination-hook 'iedit-done t)
- [nongnu] elpa/iedit 6bb8d63a97 297/301: Fix several typo errors, (continued)
- [nongnu] elpa/iedit 6bb8d63a97 297/301: Fix several typo errors, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 345431294a 294/301: Unify prefix augument handling, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 61689f6ba4 057/301: Add arg handle for iedit-mode to exclude some occurrences., ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 7479d4c947 079/301: Merge branch 'topic/multi-interface', ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 6cc86d58e6 086/301: Merge pull request #6 from gorakhargosh/master, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 4cf803d9cb 092/301: Skip the first occurrence for occur-edit-mode, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit c5ab2c593d 094/301: Avoid to restore Iedit mode when restoring desktop, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 95eb44ee30 117/301: Add new function iedit-add-next-occurrence-overlay, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit b94c75e8c6 107/301: Move iedit-help-keymap to iedit.el, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 84896f8be0 104/301: *** empty log message ***, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 962fcdb6cd 124/301: Fix failed test cases,
ELPA Syncer <=
- [nongnu] elpa/iedit 6d16d92a5a 112/301: replace iedit-occurrence-face with real face, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 57beb10db5 141/301: Remove all the dependency to the order of iedit-occurrences-overlays, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 4efe511684 128/301: allow iedit-rectangle-mode to take beg end programatically, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit e48b52e353 185/301: Merge branch 'incremental-select' of git://github.com/bmag/iedit into bmag-incremental-select, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 668ea99c51 195/301: Allow prefix for expand functions, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 007a6f9c28 206/301: check if mc present, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 7885f4beda 178/301: iedit-restrict-current-line resets expand state, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 79d0f4f3dc 155/301: Merge pull request #32 from mbneedham/master, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit df2de42fa1 149/301: Remove test-util.el, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 83c037d678 156/301: Fix infinite loop problem in iedit-rect-mode, ELPA Syncer, 2022/01/10