[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/iedit acb9fa54f3 152/301: Fix the testcase for iedit-hide-
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/iedit acb9fa54f3 152/301: Fix the testcase for iedit-hide-unmatched-lines |
Date: |
Mon, 10 Jan 2022 22:58:58 -0500 (EST) |
branch: elpa/iedit
commit acb9fa54f3b1d067ebb948cf280f2203d8e65cf0
Author: Victor Ren <victorhge@gmail.com>
Commit: Victor Ren <victorhge@gmail.com>
Fix the testcase for iedit-hide-unmatched-lines
---
iedit-lib.el | 15 +++++++--------
iedit-tests.el | 25 ++++++++++++++++++-------
2 files changed, 25 insertions(+), 15 deletions(-)
diff --git a/iedit-lib.el b/iedit-lib.el
index 7697543c3d..b3f1207d77 100644
--- a/iedit-lib.el
+++ b/iedit-lib.el
@@ -3,7 +3,7 @@
;; Copyright (C) 2010, 2011, 2012 Victor Ren
-;; Time-stamp: <2013-01-19 00:31:41 Victor Ren>
+;; Time-stamp: <2013-01-19 22:00:41 Victor Ren>
;; Author: Victor Ren <victorhge@gmail.com>
;; Keywords: occurrence region simultaneous rectangle refactoring
;; Version: 0.97
@@ -519,20 +519,19 @@ value of `iedit-occurrence-context-lines' is used for
this time."
(save-excursion
(iedit-first-occurrence)
(while (/= (point) (point-max))
+ ;; Now at the beginning of an occurrence
(let ((current-start (point)))
(forward-line (- context-lines))
(let ((line-beginning (line-beginning-position)))
(if (> line-beginning prev-occurrence-end)
- (push (list prev-occurrence-end (1- line-beginning))
unmatched-lines)))
- (goto-char current-start))
- ;; goto the end of the occurrence
- (goto-char (next-single-char-property-change (point)
'iedit-occurrence-overlay-name))
+ (push (list prev-occurrence-end (1- line-beginning))
unmatched-lines)))
+ ;; goto the end of the occurrence
+ (goto-char (next-single-char-property-change current-start
'iedit-occurrence-overlay-name)))
(let ((current-end (point)))
(forward-line context-lines)
(setq prev-occurrence-end (1+ (line-end-position)))
- (goto-char current-end))
- ;; goto the beginning of next occurrence
- (goto-char (next-single-char-property-change (point)
'iedit-occurrence-overlay-name)))
+ ;; goto the beginning of next occurrence
+ (goto-char (next-single-char-property-change current-end
'iedit-occurrence-overlay-name))))
(if (< prev-occurrence-end (point-max))
(push (list prev-occurrence-end (point-max)) unmatched-lines))
(when unmatched-lines
diff --git a/iedit-tests.el b/iedit-tests.el
index cdba17640c..12511f7955 100644
--- a/iedit-tests.el
+++ b/iedit-tests.el
@@ -2,7 +2,7 @@
;; Copyright (C) 2010, 2011, 2012 Victor Ren
-;; Time-stamp: <2013-01-19 21:32:53 Victor Ren>
+;; Time-stamp: <2013-01-19 22:18:17 Victor Ren>
;; Author: Victor Ren <victorhge@gmail.com>
;; Version: 0.97
;; X-URL: http://www.emacswiki.org/emacs/Iedit
@@ -599,22 +599,33 @@ abcd"
"12345678901234567890123456789012345678901234567890...")))
"Test function iedit-hide-unmatched-lines."
(with-iedit-test-fixture
"foo
+foo
a
- foo
+ foo bar
a
a
-barfoo
+bar foo
a
a
a
+bar foo
a
- foo"
+a
+a
+a
+ foo bar
+a
+a
+a
+a
+a
+foo"
(lambda ()
- (should (equal (iedit-hide-unmatched-lines 0) nil))
+ (should (equal (iedit-hide-unmatched-lines 0) '((64 73) (47 54) (33 38)
(21 24) (9 10))))
(iedit-show-all)
- (should (equal (iedit-hide-unmatched-lines 1) '((14 29))))
+ (should (equal (iedit-hide-unmatched-lines 1) '((66 71) (49 52) (35 36))))
(iedit-show-all)
- (should (equal (iedit-hide-unmatched-lines 2) '((6 8))))
+ (should (equal (iedit-hide-unmatched-lines 2) '((68 69)) ))
(iedit-show-all)
(should (equal (iedit-hide-unmatched-lines 3) nil)))))
- [nongnu] elpa/iedit 3bd4c15e3d 301/301: Add license file with GPLv3, (continued)
- [nongnu] elpa/iedit 3bd4c15e3d 301/301: Add license file with GPLv3, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 344ff8de91 299/301: Add iedit-autoloads.el to .gitignore, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit f88df1072b 116/301: Merge branch 'master' of github.com:victorhge/iedit, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 1bced99a26 109/301: Fix bugs when undo is in progress, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit a5d117a75a 122/301: add test-case for deleting char at end of overlay with mirror at EOB, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 78ac0ea958 105/301: Fix typo, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 6f80f88134 106/301: Differentiate lib keymap and occurrence keymap, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 9cfd76f7c2 121/301: Toggle case-sensitive with intial region, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 106185cd95 187/301: Merge branch 'bmag-incremental-select', ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 9d03d5d44e 186/301: Merge branch 'incremental-select', ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit acb9fa54f3 152/301: Fix the testcase for iedit-hide-unmatched-lines,
ELPA Syncer <=
- [nongnu] elpa/iedit 6c6522c7e9 177/301: Minor bugfix: `help-char' need not be acceptable to `char-to-string'., ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 4d50a08dd6 134/301: Add parameter back to iedit-mode-from-isearch, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit d7d5931566 127/301: Fix the arguments for after-change-functions, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 64a7905949 138/301: Rewrite iedit-hide-unmatched-lines, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit bceb12e17b 139/301: Do not jump to the first occurrence after iedit-restrict-region, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 8eb9caaa94 132/301: use real buffer for testing to ease debugging, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 8149b66ce6 140/301: Read-only text handling, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 52a7ead70c 135/301: Fix comiler error for extra ")", ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 50748a5694 160/301: ensure iedit-skip-modification-once is t in case of errors, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 060b359afc 142/301: Merge branch 'master' of github.com:victorhge/iedit, ELPA Syncer, 2022/01/10