[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/objed 1c7d142 086/216: Add more tests
From: |
Stefan Monnier |
Subject: |
[elpa] externals/objed 1c7d142 086/216: Add more tests |
Date: |
Tue, 8 Jan 2019 12:29:17 -0500 (EST) |
branch: externals/objed
commit 1c7d142f53dee1534e9f01980802a6536be9c78f
Author: Clemera <address@hidden>
Commit: Clemera <address@hidden>
Add more tests
---
test/tests.el | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 51 insertions(+), 2 deletions(-)
diff --git a/test/tests.el b/test/tests.el
index 9be103a..eb3d088 100644
--- a/test/tests.el
+++ b/test/tests.el
@@ -9,6 +9,8 @@
(real-this-command cmd)
(inhibit-message t))
(setq this-command cmd)
+ ;; pre command hook...
+ (funcall #'objed--push-state)
(call-interactively cmd)
(setq last-command cmd)))
@@ -115,8 +117,9 @@ Insert KEY if there's no command."
(point-min)
(point-max)))
(objed--exit-objed)
- ;; reset for next round
+ ;; reset for next test
(setq last-command nil)
+ (setq objed--last-states nil)
(and (buffer-name temp-buffer)
(kill-buffer temp-buffer)))))))
@@ -174,6 +177,13 @@ Insert KEY if there's no command."
(should (string= (objed-with "Testing |line here\nFollowing line here" "ae")
"<Testing line here>|\nFollowing line here")))
+(ert-deftest objed-pop-state ()
+ (should (string= (objed-with "Testing line he|re" "rr")
+ (objed-with "Testing line he|re" "rrr,")))
+ (should (string= (objed-with "Testing |line here\nFollowing line here" "n")
+ (objed-with "Testing |line here\nFollowing line here"
"npsfsb,,,,,"))))
+
+
(ert-deftest objed-choose-and-navigate-defun ()
(should (string= (objed-with "
@@ -413,6 +423,45 @@ Insert KEY if there's no command."
;; and more text>"))
))
-;; TODO: context expansion
+
+(ert-deftest objed-context-expansion ()
+ (let ((str "
+\(defun testing ()
+ (let ((a nil))
+ (message \"this is| a test\")))
+"))
+ (should (string= (objed-with str "o")
+ "
+\(defun testing ()
+ (let ((a nil))
+ (message \"|<this is a test>\")))
+"))
+ (should (string= (objed-with str "oo")
+ "
+\(defun testing ()
+ (let ((a nil))
+ (message |<\"this is a test\">)))
+"))
+ (should (string= (objed-with str "ooo")
+ "
+\(defun testing ()
+ (let ((a nil))
+ |<(message \"this is a test\")>))
+"))
+ (should (string= (objed-with str "oooo")
+ "
+\(defun testing ()
+ |<(let ((a nil))
+ (message \"this is a test\"))>)
+"))
+ (should (string= (objed-with str "ooooo")
+ "
+|<\(defun testing ()
+ (let ((a nil))
+ (message \"this is a test\")))>
+"))))
+
+;; TODO: op tests, marking, remaining commands
+
(provide 'tests)
- [elpa] externals/objed f605604 057/216: Rename syntax object to face object, (continued)
- [elpa] externals/objed f605604 057/216: Rename syntax object to face object, Stefan Monnier, 2019/01/08
- [elpa] externals/objed e94dc45 049/216: Remove :get-inner, Stefan Monnier, 2019/01/08
- [elpa] externals/objed ad88f19 074/216: Fix markup!!!, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 37449f5 063/216: Update link, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 975a8f3 082/216: Rewording, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 4badbe8 047/216: Simplify object macro usage (allow to use bounds of thing etc.), Stefan Monnier, 2019/01/08
- [elpa] externals/objed fc0da6e 079/216: Don't produce messages for tests, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 809c834 072/216: Fix markup, Stefan Monnier, 2019/01/08
- [elpa] externals/objed cd7c738 053/216: Undo C-h remapping, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 45eb117 087/216: Add alternative bindings, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 1c7d142 086/216: Add more tests,
Stefan Monnier <=
- [elpa] externals/objed 8d6732e 094/216: Improve description, Stefan Monnier, 2019/01/08
- [elpa] externals/objed a090ada 056/216: Stop object search at buffer boundaries earlier, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 8764254 081/216: Add note about tests to contribute, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 3eb73e0 060/216: Adjust indent op and tab commands, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 5fbacd4 050/216: Cleanup, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 5f23c05 070/216: Fixup advice code, Stefan Monnier, 2019/01/08
- [elpa] externals/objed bd6a50c 092/216: Change bindings for surroundings, undo in region, Stefan Monnier, 2019/01/08
- [elpa] externals/objed aa8ba7b 093/216: Change DEL to behave as normal for char object, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 21ca995 069/216: Cleanup malformed object, Stefan Monnier, 2019/01/08
- [elpa] externals/objed d21fd72 073/216: Fix makup again, Stefan Monnier, 2019/01/08