branch: elpa/evil-numbers
commit cb9eb99998b70eb1166f59748a8432be661439a7
Author: Campbell Barton <[email protected]>
Commit: Campbell Barton <[email protected]>
Tests: add simple-nop-non-number-with-newline-after test
There have been issues in the past where the newline
boundary was ignored. Add another test to ensure it's not.
Signed-off-by: Campbell Barton <[email protected]>
---
tests/evil-numbers-test.el | 24 +++++++++++++++++++++---
1 file changed, 21 insertions(+), 3 deletions(-)
diff --git a/tests/evil-numbers-test.el b/tests/evil-numbers-test.el
index f2c1e770a5..71d4db00ad 100644
--- a/tests/evil-numbers-test.el
+++ b/tests/evil-numbers-test.el
@@ -134,16 +134,34 @@
(simulate-input (kbd "C-a") "a|")
(should (equal text-expected (buffer-string))))))
+(ert-deftest simple-nop-non-number-signed ()
+ "Do nothing, the value under the cursor is not a number, but it has a sign."
+ (let ((text-expected "-|X")
+ (text-initial "-X"))
+ (with-evil-numbers-test
+ text-initial
+ (simulate-input (kbd "C-a") "a|")
+ (should (equal text-expected (buffer-string))))))
+
;; See bug #25.
-(ert-deftest simple-nop-non-number-with-newline ()
+(ert-deftest simple-nop-non-number-with-newline-before ()
"Do nothing, ensure the newline isn't stepped over."
- (let ((text-expected "X|\n0")
- (text-initial "X\n0"))
+ (let ((text-expected "|\n0")
+ (text-initial "\n0"))
(with-evil-numbers-test
text-initial
(simulate-input (kbd "<end>") (kbd "C-a") "a|")
(should (equal text-expected (buffer-string))))))
+(ert-deftest simple-nop-non-number-with-newline-after ()
+ "Do nothing, ensure the newline isn't stepped over."
+ (let ((text-expected "0\n|")
+ (text-initial "0\n"))
+ (with-evil-numbers-test
+ text-initial
+ (simulate-input "j" (kbd "C-a") "a|")
+ (should (equal text-expected (buffer-string))))))
+
(ert-deftest simple-nop-cursor-after-decimal ()
"Do nothing, the cursor is after the number so it shouldn't be modified."
(let ((text-expected "1 |\n")