branch: externals/objed commit c179aa4e9eeccbce0afb7deb6788f0fc2b2dff42 Author: Clemens Radermacher <clem...@posteo.net> Commit: Clemens Radermacher <clem...@posteo.net>
Move all tests to test files Each directory under tests creates an ert-deftest comparing the before/after state defined in the test files of the directory. --- test/tests.el | 372 +++------------------ test/tests/{activate => 00_activate}/backward-word | 3 + .../{activate => 00_activate}/beginning-of-defun | 1 + .../{activate => 00_activate}/beginning-of-line | 2 + test/tests/{activate => 00_activate}/forward-word | 3 + test/tests/{activate => 00_activate}/next-line | 3 + test/tests/basic-movement/2b | 5 + .../{activate/forward-word => basic-movement/2r} | 4 +- test/tests/basic-movement/2s | 5 + test/tests/basic-movement/3f | 5 + test/tests/basic-movement/a | 7 + test/tests/basic-movement/ae | 7 + test/tests/basic-movement/bb | 5 + test/tests/basic-movement/e | 7 + test/tests/basic-movement/fff | 5 + test/tests/basic-movement/n | 8 + test/tests/basic-movement/npsrfb | 7 + test/tests/basic-movement/p | 7 + .../{activate/forward-word => basic-movement/rr} | 4 +- test/tests/basic-movement/ss | 5 + test/tests/expansion/beg_block_1 | 17 + test/tests/expansion/beg_block_2 | 17 + test/tests/expansion/beg_block_3 | 17 + test/tests/expansion/beg_block_4 | 17 + test/tests/expansion/beg_block_5 | 17 + test/tests/expansion/block_1 | 18 + test/tests/expansion/block_2 | 18 + test/tests/expansion/block_3 | 17 + test/tests/expansion/block_4 | 18 + test/tests/expansion/block_5 | 18 + test/tests/expansion/block_6 | 18 + test/tests/expansion/context_1 | 13 + test/tests/expansion/context_2 | 14 + test/tests/expansion/context_3 | 16 + test/tests/expansion/context_4 | 13 + test/tests/expansion/context_5 | 15 + test/tests/expansion/end_block_1 | 25 ++ test/tests/expansion/end_block_2 | 25 ++ test/tests/expansion/end_block_3 | 25 ++ test/tests/expansion/end_block_4 | 25 ++ test/tests/expansion/end_block_5 | 25 ++ test/tests/expansion/end_block_6 | 25 ++ test/tests/navigate-objects/defun | 32 ++ test/tests/state/npsfsb_pop | 7 + test/tests/{activate/forward-word => state/rrrpop} | 4 +- 45 files changed, 590 insertions(+), 331 deletions(-) diff --git a/test/tests.el b/test/tests.el index 47c58bf..5c3d658 100644 --- a/test/tests.el +++ b/test/tests.el @@ -4,8 +4,8 @@ ;; activate on load (objed-mode 1) -(setq-default require-final-newline nil) +;;* Simulate interactions ;; defuns adapted from lispy-test.el (defun objed--call-object-interactively (o &optional cmd) @@ -131,21 +131,23 @@ Insert KEY if there's no command." (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))))) -(defvar objed--count 1) +;;* Test creation -(defun objed-get-test (file) +(defun objed-parse-test (file) (let ((parsed nil)) (with-temp-buffer (insert-file-contents file) + (delete-trailing-whitespace) (goto-char (point-min)) (push (buffer-substring (line-beginning-position) (line-end-position)) parsed) (search-forward ";;;;" nil t) (forward-line 1) - (push (buffer-substring (point) (progn (search-forward ";;;;") + (push (buffer-substring (point) (progn (search-forward ";;;;" nil t) (forward-char -4) (point))) parsed) + (search-forward ";;;;" nil t) (forward-line 1) (push (buffer-substring (point) (point-max)) @@ -153,349 +155,69 @@ Insert KEY if there's no command." (nreverse parsed))) -(defmacro objed-test (file) - (let* ((parsed (objed-get-test file)) +(defun objed-equal (str1 str2) + (let* ((str1 (replace-regexp-in-string "\\( \\|\n\\|\t\\)+\\'" "" str1)) + (str1 (replace-regexp-in-string "\\`\\( \\|\n\\|\t\\)+" "" str1)) + (str2 (replace-regexp-in-string "\\( \\|\n\\|\t\\)+\\'" "" str2)) + (str2 (replace-regexp-in-string "\\`\\( \\|\n\\|\t\\)+" "" str2))) + (string= str1 str2))) + + +(defmacro objed-create-test (file) + (let* ((parsed (objed-parse-test file)) (key (nth 0 parsed)) (str1 (nth 1 parsed)) (str2 (nth 2 parsed))) - ;; show data in ouput... - `(should (string= (objed-with ,str1 ,key nil ,file) - ,str2)))) + `(should (objed-equal (objed-with ,str1 ,key) + (prog1 ,str2 + ;; show path of test in compile output + ,file))))) (defmacro objed-create-tests-for (dir) - (let ((files (directory-files (format "test/tests/%s" dir) t "^[^.]")) + (let ((files (directory-files + (expand-file-name + (format "tests/%s" dir) + (file-name-directory + (or load-file-name default-directory))) t "^[^.]")) (body nil)) - (push 'progn body) + (push 'ert-deftest body) + (push (intern (format "objed-%s" dir)) body) + (push nil body) (dolist (file files) - (push `(objed-test ,file) body)) + (push `(objed-create-test ,file) body)) (nreverse body))) +;; (should (string= (objed-with "Testing line he|re" +;; (objed--call-object-interactively 'line)) +;; "|<Testing line here>")) -;; needs to come first initializes, for tests, too -(ert-deftest objed-activate () - (objed-create-tests-for "activate") - ;; (should (string= (objed-with "Testing line he|re" - ;; (objed--call-object-interactively 'line)) - ;; "|<Testing line here>")) - ) - - -(ert-deftest objed-basic-movement () - (should (string= (objed-with "Testing line he|re" "rr") - "Testing |<line> here")) - (should (string= (objed-with "Testing line he|re" "2r") - "Testing |<line> here")) - (should (string= (objed-with "Tes|ting line here" "ss") - "Testing <line>| here")) - (should (string= (objed-with "Tes|ting line here" "2s") - "Testing <line>| here")) - (should (string= (objed-with "Tes|ting line" "bb") - "T|<e>sting line")) - (should (string= (objed-with "Tes|ting line" "2b") - "T|<e>sting line")) - (should (string= (objed-with "Tes|ting line" "fff") - "Testin|<g> line")) - (should (string= (objed-with "Tes|ting line" "3f") - "Testin|<g> line")) - (should (string= (objed-with ";; this is the previous line\n;; this is| the current line" "p") - "<;; this is| the previous line\n>;; this is the current line")) - (should (string= (objed-with ";; this is a| test\n;; this is the next line" "n") - ";; this is a test\n<;; this is t|he next line>")) - (should (string= (objed-with "Testing |line here\nFollowing line here" "npsrfb") - "Testing |<l>ine here\nFollowing line here")) - (should (string= (objed-with "Testing |line here\nFollowing line here" "e") - "Testing <line here>|\nFollowing line here")) - (should (string= (objed-with "Testing |line here\nFollowing line here" "a") - "|<Testing >line here\nFollowing line here")) - (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 " -\(defun objed--save-start-position (&rest _) - \"Save position of point via `objed--opoint'.\" - (setq objed--opoint (point))) - -\(defun objed--goto-start (&optional _) - \"Goto start |of current object if there is one.\" - (when objed--current-obj - (goto-char (objed--beg)))) - -\(defun objed--object-trailing-line (pos) - \"Activate trailing part from POS.\" - (unless (eq objed--obj-state 'inner) - (objed--reverse)) - (objed--change-to :beg pos :ibeg pos))" - "cdthh") -" -\(defun objed--save-start-position (&rest _) - \"Save position of point via `objed--opoint'.\" - (setq objed--opoint (point))) - -\(defun objed--goto-start (&optional _) - \"Goto start of current object if there is one.\" - (when objed--current-obj - (goto-char (objed--beg)))) -< -|(defun objed--object-trailing-line (pos) - \"Activate trailing part from POS.\" - (unless (eq objed--obj-state 'inner) - (objed--reverse)) - (objed--change-to :beg pos :ibeg pos))>"))) - -(ert-deftest objed-beg-of-block-expansion () - - (let ((string " -\(defun check () - (ignore)) - -;; More on same level - -;; Some text -;; and |more text")) - (should (string= (objed-with string "a") - " -\(defun check () - (ignore)) - -;; More on same level - -;; Some text -|<;; and >more text")) - (should (string= (objed-with string "aa") - " -\(defun check () - (ignore)) - -;; More on same level - -|<;; Some text -;; and >more text")) - (should (string= (objed-with string "aaa") - " -\(defun check () - (ignore)) - -;; More on same level -|< -;; Some text -;; and >more text")) - (should (string= (objed-with string "aaaa") - " -\(defun check () - (ignore)) - -|<;; More on same level - -;; Some text -;; and >more text")) - (should (string= (objed-with string "aaaaa") - "|< -\(defun check () - (ignore)) - -;; More on same level - -;; Some text -;; and >more text")))) - -(ert-deftest objed-end-of-block-expansion () - (let ((string " -;; Some |text -;; and more text -;; -;; - -;; Comment end - -\(defun check () - (ignore)) - -;; buffer end")) - (should (string= (objed-with string "e") - " -;; Some <text>| -;; and more text -;; -;; - -;; Comment end - -\(defun check () - (ignore)) - -;; buffer end")) - (should (string= (objed-with string "ee") - " -;; Some <text -;; and more text>| -;; -;; - -;; Comment end - -\(defun check () - (ignore)) +(defmacro objed-create-tests () + (let ((dirs (directory-files + (expand-file-name + "tests" + (file-name-directory + (or load-file-name default-directory))) t "^[^.]")) + (body nil)) + (push 'progn body) + (dolist (dir dirs) + (push `(objed-create-tests-for ,(file-name-nondirectory dir)) + body)) + (nreverse body))) -;; buffer end")) - (should (string= (objed-with string "eee") - " -;; Some <text -;; and more text -;; -;;>| -;; Comment end +(objed-create-tests) -\(defun check () - (ignore)) -;; buffer end")) - (should (string= (objed-with string "eeee") - " -;; Some <text -;; and more text -;; -;; -;; Comment end>| -\(defun check () - (ignore)) -;; buffer end")) - (should (string= (objed-with string "eeeee") - " -;; Some <text -;; and more text -;; -;; +;; TODO: op tests, marking, remaining commands -;; Comment end -\(defun check ()>| - (ignore)) +(provide 'tests) -;; buffer end")) - (should (string= (objed-with string "eeeeee") - " -;; Some <text -;; and more text -;; -;; -;; Comment end - -\(defun check () - (ignore)) - -;; buffer end>|")))) - - -(ert-deftest objed-block-expansion () - (let ((string " -\(defun check () - (ignore)) - -;; More on same level - -;; Some text -;; and |more text")) - (should (string= (objed-with string "l") - " -\(defun check () - (ignore)) - -;; More on same level - -;; Some text -|<;; and more text>")) - (should (string= (objed-with string "ll") - " -\(defun check () - (ignore)) - -;; More on same level - -|<;; Some text -;; and more text>")) - (should (string= (objed-with string "lll") - " -\(defun check () - (ignore)) - -;; More on same level -|< -;; Some text -;; and more text>")) - (should (string= (objed-with string "llll") - " -\(defun check () - (ignore)) - -|<;; More on same level - -;; Some text -;; and more text>")) - (should (string= (objed-with string "lllll") - "|< -\(defun check () - (ignore)) - -;; More on same level - -;; Some text -;; and more text>")) - -)) - -(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) diff --git a/test/tests/activate/backward-word b/test/tests/00_activate/backward-word similarity index 94% rename from test/tests/activate/backward-word rename to test/tests/00_activate/backward-word index 2887599..3ca5528 100644 --- a/test/tests/activate/backward-word +++ b/test/tests/00_activate/backward-word @@ -1,5 +1,8 @@ M-b ;;;; + Testing line he|re + ;;;; + Testing line |<here> diff --git a/test/tests/activate/beginning-of-defun b/test/tests/00_activate/beginning-of-defun similarity index 99% rename from test/tests/activate/beginning-of-defun rename to test/tests/00_activate/beginning-of-defun index d11186b..84fc337 100644 --- a/test/tests/activate/beginning-of-defun +++ b/test/tests/00_activate/beginning-of-defun @@ -6,6 +6,7 @@ C-M-a (setq objed--opoint (point))) ;;;; + < |(defun objed--save-start-position (&rest _) "Save position of point via `objed--opoint'." diff --git a/test/tests/activate/beginning-of-line b/test/tests/00_activate/beginning-of-line similarity index 94% rename from test/tests/activate/beginning-of-line rename to test/tests/00_activate/beginning-of-line index e0962b0..571073f 100644 --- a/test/tests/activate/beginning-of-line +++ b/test/tests/00_activate/beginning-of-line @@ -1,6 +1,8 @@ C-a ;;;; + Testing line he|re ;;;; + |<Testing line here > \ No newline at end of file diff --git a/test/tests/activate/forward-word b/test/tests/00_activate/forward-word similarity index 94% copy from test/tests/activate/forward-word copy to test/tests/00_activate/forward-word index 37f9586..a751a80 100644 --- a/test/tests/activate/forward-word +++ b/test/tests/00_activate/forward-word @@ -1,5 +1,8 @@ M-f ;;;; + Testing line he|re + ;;;; + Testing line <here>| diff --git a/test/tests/activate/next-line b/test/tests/00_activate/next-line similarity index 95% rename from test/tests/activate/next-line rename to test/tests/00_activate/next-line index fa17c33..00597f7 100644 --- a/test/tests/activate/next-line +++ b/test/tests/00_activate/next-line @@ -1,8 +1,11 @@ C-n ;;;; + Testing line he|re Following line here + ;;;; + Testing line here <Following line |here > \ No newline at end of file diff --git a/test/tests/basic-movement/2b b/test/tests/basic-movement/2b new file mode 100644 index 0000000..5dd32c0 --- /dev/null +++ b/test/tests/basic-movement/2b @@ -0,0 +1,5 @@ +2b +;;;; +Tes|ting line +;;;; +T|<e>sting line diff --git a/test/tests/activate/forward-word b/test/tests/basic-movement/2r similarity index 53% copy from test/tests/activate/forward-word copy to test/tests/basic-movement/2r index 37f9586..46d9d6d 100644 --- a/test/tests/activate/forward-word +++ b/test/tests/basic-movement/2r @@ -1,5 +1,5 @@ -M-f +2r ;;;; Testing line he|re ;;;; -Testing line <here>| +Testing |<line> here diff --git a/test/tests/basic-movement/2s b/test/tests/basic-movement/2s new file mode 100644 index 0000000..275708d --- /dev/null +++ b/test/tests/basic-movement/2s @@ -0,0 +1,5 @@ +2s +;;;; +Tes|ting line here +;;;; +Testing <line>| here diff --git a/test/tests/basic-movement/3f b/test/tests/basic-movement/3f new file mode 100644 index 0000000..cd0cd67 --- /dev/null +++ b/test/tests/basic-movement/3f @@ -0,0 +1,5 @@ +3f +;;;; +Tes|ting line +;;;; +Testin|<g> line diff --git a/test/tests/basic-movement/a b/test/tests/basic-movement/a new file mode 100644 index 0000000..4598f2c --- /dev/null +++ b/test/tests/basic-movement/a @@ -0,0 +1,7 @@ +a +;;;; +Testing |line here +Following line here +;;;; +|<Testing >line here +Following line here diff --git a/test/tests/basic-movement/ae b/test/tests/basic-movement/ae new file mode 100644 index 0000000..4ac2cbc --- /dev/null +++ b/test/tests/basic-movement/ae @@ -0,0 +1,7 @@ +ae +;;;; +Testing |line here +Following line here +;;;; +<Testing line here>| +Following line here diff --git a/test/tests/basic-movement/bb b/test/tests/basic-movement/bb new file mode 100644 index 0000000..2beef2a --- /dev/null +++ b/test/tests/basic-movement/bb @@ -0,0 +1,5 @@ +bb +;;;; +Tes|ting line +;;;; +T|<e>sting line diff --git a/test/tests/basic-movement/e b/test/tests/basic-movement/e new file mode 100644 index 0000000..199e931 --- /dev/null +++ b/test/tests/basic-movement/e @@ -0,0 +1,7 @@ +e +;;;; +Testing |line here +Following line here +;;;; +Testing <line here>| +Following line here diff --git a/test/tests/basic-movement/fff b/test/tests/basic-movement/fff new file mode 100644 index 0000000..fece0ed --- /dev/null +++ b/test/tests/basic-movement/fff @@ -0,0 +1,5 @@ +fff +;;;; +Tes|ting line +;;;; +Testin|<g> line diff --git a/test/tests/basic-movement/n b/test/tests/basic-movement/n new file mode 100644 index 0000000..8759843 --- /dev/null +++ b/test/tests/basic-movement/n @@ -0,0 +1,8 @@ +n +;;;; +;; this is a| test +;; this is the next line +;;;; +;; this is a test +<;; this is t|he next line +> \ No newline at end of file diff --git a/test/tests/basic-movement/npsrfb b/test/tests/basic-movement/npsrfb new file mode 100644 index 0000000..fb0eb95 --- /dev/null +++ b/test/tests/basic-movement/npsrfb @@ -0,0 +1,7 @@ +npsrfb +;;;; +Testing |line here +Following line here +;;;; +Testing |<l>ine here +Following line here diff --git a/test/tests/basic-movement/p b/test/tests/basic-movement/p new file mode 100644 index 0000000..f737e7a --- /dev/null +++ b/test/tests/basic-movement/p @@ -0,0 +1,7 @@ +p +;;;; +;; this is the previous line +;; this is| the current line +;;;; +<;; this is| the previous line +>;; this is the current line diff --git a/test/tests/activate/forward-word b/test/tests/basic-movement/rr similarity index 53% copy from test/tests/activate/forward-word copy to test/tests/basic-movement/rr index 37f9586..b12d365 100644 --- a/test/tests/activate/forward-word +++ b/test/tests/basic-movement/rr @@ -1,5 +1,5 @@ -M-f +rr ;;;; Testing line he|re ;;;; -Testing line <here>| +Testing |<line> here diff --git a/test/tests/basic-movement/ss b/test/tests/basic-movement/ss new file mode 100644 index 0000000..0497571 --- /dev/null +++ b/test/tests/basic-movement/ss @@ -0,0 +1,5 @@ +ss +;;;; +Tes|ting line here +;;;; +Testing <line>| here diff --git a/test/tests/expansion/beg_block_1 b/test/tests/expansion/beg_block_1 new file mode 100644 index 0000000..7a39ce7 --- /dev/null +++ b/test/tests/expansion/beg_block_1 @@ -0,0 +1,17 @@ +a +;;;; +(defun check () + (ignore)) + +;; More on same level + +;; Some text +;; and |more text +;;;; +(defun check () + (ignore)) + +;; More on same level + +;; Some text +|<;; and >more text diff --git a/test/tests/expansion/beg_block_2 b/test/tests/expansion/beg_block_2 new file mode 100644 index 0000000..12d9097 --- /dev/null +++ b/test/tests/expansion/beg_block_2 @@ -0,0 +1,17 @@ +aa +;;;; +(defun check () + (ignore)) + +;; More on same level + +;; Some text +;; and |more text +;;;; +(defun check () + (ignore)) + +;; More on same level + +|<;; Some text +;; and >more text \ No newline at end of file diff --git a/test/tests/expansion/beg_block_3 b/test/tests/expansion/beg_block_3 new file mode 100644 index 0000000..0dd50b1 --- /dev/null +++ b/test/tests/expansion/beg_block_3 @@ -0,0 +1,17 @@ +aaa +;;;; +(defun check () + (ignore)) + +;; More on same level + +;; Some text +;; and |more text +;;;; +(defun check () + (ignore)) + +;; More on same level +|< +;; Some text +;; and >more text \ No newline at end of file diff --git a/test/tests/expansion/beg_block_4 b/test/tests/expansion/beg_block_4 new file mode 100644 index 0000000..57a7b17 --- /dev/null +++ b/test/tests/expansion/beg_block_4 @@ -0,0 +1,17 @@ +aaaa +;;;; +(defun check () + (ignore)) + +;; More on same level + +;; Some text +;; and |more text +;;;; +(defun check () + (ignore)) + +|<;; More on same level + +;; Some text +;; and >more text \ No newline at end of file diff --git a/test/tests/expansion/beg_block_5 b/test/tests/expansion/beg_block_5 new file mode 100644 index 0000000..66a52c3 --- /dev/null +++ b/test/tests/expansion/beg_block_5 @@ -0,0 +1,17 @@ +aaaaa +;;;; +(defun check () + (ignore)) + +;; More on same level + +;; Some text +;; and |more text +;;;; +|<(defun check () + (ignore)) + +;; More on same level + +;; Some text +;; and >more text \ No newline at end of file diff --git a/test/tests/expansion/block_1 b/test/tests/expansion/block_1 new file mode 100644 index 0000000..b26729e --- /dev/null +++ b/test/tests/expansion/block_1 @@ -0,0 +1,18 @@ +l +;;;; +(defun check () + (ignore)) + +;; More on same level + +;; Some text +;; and |more text +;;;; +(defun check () + (ignore)) + +;; More on same level + +;; Some text +|<;; and more text +> diff --git a/test/tests/expansion/block_2 b/test/tests/expansion/block_2 new file mode 100644 index 0000000..bc0857d --- /dev/null +++ b/test/tests/expansion/block_2 @@ -0,0 +1,18 @@ +ll +;;;; +(defun check () + (ignore)) + +;; More on same level + +;; Some text +;; and |more text +;;;; +(defun check () + (ignore)) + +;; More on same level + +|<;; Some text +;; and more text +> \ No newline at end of file diff --git a/test/tests/expansion/block_3 b/test/tests/expansion/block_3 new file mode 100644 index 0000000..0f50a2a --- /dev/null +++ b/test/tests/expansion/block_3 @@ -0,0 +1,17 @@ +lll +;;;; +(defun check () + (ignore)) + +;; More on same level + +;; Some text +;; and |more text +;;;; +(defun check () + (ignore)) + +;; More on same level + +|<;; Some text +;; and more text> diff --git a/test/tests/expansion/block_4 b/test/tests/expansion/block_4 new file mode 100644 index 0000000..85537c6 --- /dev/null +++ b/test/tests/expansion/block_4 @@ -0,0 +1,18 @@ +llll +;;;; +(defun check () + (ignore)) + +;; More on same level + +;; Some text +;; and |more text +;;;; +(defun check () + (ignore)) + +;; More on same level +|< +;; Some text +;; and more text +> diff --git a/test/tests/expansion/block_5 b/test/tests/expansion/block_5 new file mode 100644 index 0000000..2c24519 --- /dev/null +++ b/test/tests/expansion/block_5 @@ -0,0 +1,18 @@ +lllll +;;;; +(defun check () + (ignore)) + +;; More on same level + +;; Some text +;; and |more text +;;;; +(defun check () + (ignore)) + +|<;; More on same level + +;; Some text +;; and more text +> diff --git a/test/tests/expansion/block_6 b/test/tests/expansion/block_6 new file mode 100644 index 0000000..ecb91bc --- /dev/null +++ b/test/tests/expansion/block_6 @@ -0,0 +1,18 @@ +llllll +;;;; +(defun check () + (ignore)) + +;; More on same level + +;; Some text +;; and |more text +;;;; +|<(defun check () + (ignore)) + +;; More on same level + +;; Some text +;; and more text +> diff --git a/test/tests/expansion/context_1 b/test/tests/expansion/context_1 new file mode 100644 index 0000000..68dd554 --- /dev/null +++ b/test/tests/expansion/context_1 @@ -0,0 +1,13 @@ +o +;;;; + +(defun testing () + (let ((a nil)) + (message "this is| a test"))) + +;;;; + +(defun testing () + (let ((a nil)) + (message "|<this is a test>"))) + diff --git a/test/tests/expansion/context_2 b/test/tests/expansion/context_2 new file mode 100644 index 0000000..3caad3e --- /dev/null +++ b/test/tests/expansion/context_2 @@ -0,0 +1,14 @@ +oo +;;;; + +(defun testing () + (let ((a nil)) + (message "this is| a test"))) + +;;;; + +(defun testing () + (let ((a nil)) + (message |<"this is a test">))) + + diff --git a/test/tests/expansion/context_3 b/test/tests/expansion/context_3 new file mode 100644 index 0000000..e4c208a --- /dev/null +++ b/test/tests/expansion/context_3 @@ -0,0 +1,16 @@ +ooo +;;;; + +(defun testing () + (let ((a nil)) + (message "this is| a test"))) + +;;;; + +(defun testing () + (let ((a nil)) + |<(message "this is a test")>)) + + + + diff --git a/test/tests/expansion/context_4 b/test/tests/expansion/context_4 new file mode 100644 index 0000000..8b03aa0 --- /dev/null +++ b/test/tests/expansion/context_4 @@ -0,0 +1,13 @@ +oooo +;;;; + +(defun testing () + (let ((a nil)) + (message "this is| a test"))) + +;;;; + +(defun testing () + |<(let ((a nil)) + (message "this is a test"))>) + diff --git a/test/tests/expansion/context_5 b/test/tests/expansion/context_5 new file mode 100644 index 0000000..0665c09 --- /dev/null +++ b/test/tests/expansion/context_5 @@ -0,0 +1,15 @@ +ooooo +;;;; + +(defun testing () + (let ((a nil)) + (message "this is| a test"))) + +;;;; + +|<(defun testing () + (let ((a nil)) + (message "this is a test")))> + + + diff --git a/test/tests/expansion/end_block_1 b/test/tests/expansion/end_block_1 new file mode 100644 index 0000000..dbb0150 --- /dev/null +++ b/test/tests/expansion/end_block_1 @@ -0,0 +1,25 @@ +e +;;;; +;; Some |text +;; and more text +;; +;; + +;; Comment end + +(defun check () + (ignore)) + +;; buffer end +;;;; +;; Some <text>| +;; and more text +;; +;; + +;; Comment end + +(defun check () + (ignore)) + +;; buffer end diff --git a/test/tests/expansion/end_block_2 b/test/tests/expansion/end_block_2 new file mode 100644 index 0000000..40eb66c --- /dev/null +++ b/test/tests/expansion/end_block_2 @@ -0,0 +1,25 @@ +ee +;;;; +;; Some |text +;; and more text +;; +;; + +;; Comment end + +(defun check () + (ignore)) + +;; buffer end +;;;; +;; Some <text +;; and more text>| +;; +;; + +;; Comment end + +(defun check () + (ignore)) + +;; buffer end \ No newline at end of file diff --git a/test/tests/expansion/end_block_3 b/test/tests/expansion/end_block_3 new file mode 100644 index 0000000..116d036 --- /dev/null +++ b/test/tests/expansion/end_block_3 @@ -0,0 +1,25 @@ +eee +;;;; +;; Some |text +;; and more text +;; +;; + +;; Comment end + +(defun check () + (ignore)) + +;; buffer end +;;;; +;; Some <text +;; and more text +;; +;;>| + +;; Comment end + +(defun check () + (ignore)) + +;; buffer end \ No newline at end of file diff --git a/test/tests/expansion/end_block_4 b/test/tests/expansion/end_block_4 new file mode 100644 index 0000000..01a385c --- /dev/null +++ b/test/tests/expansion/end_block_4 @@ -0,0 +1,25 @@ +eeee +;;;; +;; Some |text +;; and more text +;; +;; + +;; Comment end + +(defun check () + (ignore)) + +;; buffer end +;;;; +;; Some <text +;; and more text +;; +;; + +;; Comment end>| + +(defun check () + (ignore)) + +;; buffer end \ No newline at end of file diff --git a/test/tests/expansion/end_block_5 b/test/tests/expansion/end_block_5 new file mode 100644 index 0000000..300c6ec --- /dev/null +++ b/test/tests/expansion/end_block_5 @@ -0,0 +1,25 @@ +eeeee +;;;; +;; Some |text +;; and more text +;; +;; + +;; Comment end + +(defun check () + (ignore)) + +;; buffer end +;;;; +;; Some <text +;; and more text +;; +;; + +;; Comment end + +(defun check ()>| + (ignore)) + +;; buffer end \ No newline at end of file diff --git a/test/tests/expansion/end_block_6 b/test/tests/expansion/end_block_6 new file mode 100644 index 0000000..4faee9b --- /dev/null +++ b/test/tests/expansion/end_block_6 @@ -0,0 +1,25 @@ +eeeeee +;;;; +;; Some |text +;; and more text +;; +;; + +;; Comment end + +(defun check () + (ignore)) + +;; buffer end +;;;; +;; Some <text +;; and more text +;; +;; + +;; Comment end + +(defun check () + (ignore)) + +;; buffer end>| \ No newline at end of file diff --git a/test/tests/navigate-objects/defun b/test/tests/navigate-objects/defun new file mode 100644 index 0000000..67909d8 --- /dev/null +++ b/test/tests/navigate-objects/defun @@ -0,0 +1,32 @@ +cdthh +;;;; +(defun objed--save-start-position (&rest _) + "Save position of point via `objed--opoint'." + (setq objed--opoint (point))) + +(defun objed--goto-start (&optional _) + "Goto start |of current object if there is one." + (when objed--current-obj + (goto-char (objed--beg)))) + +(defun objed--object-trailing-line (pos) + "Activate trailing part from POS." + (unless (eq objed--obj-state 'inner) + (objed--reverse)) + (objed--change-to :beg pos :ibeg pos)) +;;;; +(defun objed--save-start-position (&rest _) + "Save position of point via `objed--opoint'." + (setq objed--opoint (point))) + +(defun objed--goto-start (&optional _) + "Goto start of current object if there is one." + (when objed--current-obj + (goto-char (objed--beg)))) +< +|(defun objed--object-trailing-line (pos) + "Activate trailing part from POS." + (unless (eq objed--obj-state 'inner) + (objed--reverse)) + (objed--change-to :beg pos :ibeg pos)) +> diff --git a/test/tests/state/npsfsb_pop b/test/tests/state/npsfsb_pop new file mode 100644 index 0000000..b4dba03 --- /dev/null +++ b/test/tests/state/npsfsb_pop @@ -0,0 +1,7 @@ +npsfsb,,,,,, +;;;; +Testing |line here +Following line here +;;;; +Testing |<l>ine here +Following line here diff --git a/test/tests/activate/forward-word b/test/tests/state/rrrpop similarity index 52% rename from test/tests/activate/forward-word rename to test/tests/state/rrrpop index 37f9586..8519485 100644 --- a/test/tests/activate/forward-word +++ b/test/tests/state/rrrpop @@ -1,5 +1,5 @@ -M-f +rrr, ;;;; Testing line he|re ;;;; -Testing line <here>| +Testing |<line> here