aboutsummaryrefslogtreecommitdiffstats
path: root/test/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'test/lisp')
-rw-r--r--test/lisp/eshell/em-ls-tests.el14
-rw-r--r--test/lisp/net/secrets-tests.el7
-rw-r--r--test/lisp/progmodes/ruby-mode-tests.el90
3 files changed, 104 insertions, 7 deletions
diff --git a/test/lisp/eshell/em-ls-tests.el b/test/lisp/eshell/em-ls-tests.el
index c5c9eac3249..b89a54641bd 100644
--- a/test/lisp/eshell/em-ls-tests.el
+++ b/test/lisp/eshell/em-ls-tests.el
@@ -78,6 +78,11 @@
78 78
79(ert-deftest em-ls-test-bug27844 () 79(ert-deftest em-ls-test-bug27844 ()
80 "Test for https://debbugs.gnu.org/27844 ." 80 "Test for https://debbugs.gnu.org/27844 ."
81 ;; FIXME: it would be better to use something other than source-directory
82 ;; in this test.
83 (skip-unless (and source-directory
84 (file-exists-p
85 (expand-file-name "lisp/subr.el" source-directory))))
81 (let ((orig eshell-ls-use-in-dired) 86 (let ((orig eshell-ls-use-in-dired)
82 (dired-use-ls-dired 'unspecified) 87 (dired-use-ls-dired 'unspecified)
83 buf insert-directory-program) 88 buf insert-directory-program)
@@ -89,6 +94,15 @@
89 (should (cdr (dired-get-marked-files))) 94 (should (cdr (dired-get-marked-files)))
90 (kill-buffer buf) 95 (kill-buffer buf)
91 (setq buf (dired (expand-file-name "lisp/subr.el" source-directory))) 96 (setq buf (dired (expand-file-name "lisp/subr.el" source-directory)))
97 (when (getenv "EMACS_HYDRA_CI")
98 (message "X1%s" (buffer-substring-no-properties
99 (point-min) (point-max)))
100 (message "X2%s" (buffer-substring-no-properties
101 (line-beginning-position)
102 (line-end-position)))
103 (message "X3%s" (buffer-substring-no-properties
104 (point)
105 (line-end-position))))
92 (should (looking-at "subr\\.el"))) 106 (should (looking-at "subr\\.el")))
93 (customize-set-variable 'eshell-ls-use-in-dired orig) 107 (customize-set-variable 'eshell-ls-use-in-dired orig)
94 (and (buffer-live-p buf) (kill-buffer))))) 108 (and (buffer-live-p buf) (kill-buffer)))))
diff --git a/test/lisp/net/secrets-tests.el b/test/lisp/net/secrets-tests.el
index de3ce731bec..d34b0021952 100644
--- a/test/lisp/net/secrets-tests.el
+++ b/test/lisp/net/secrets-tests.el
@@ -90,10 +90,6 @@
90 (unwind-protect 90 (unwind-protect
91 (progn 91 (progn
92 (should (secrets-open-session)) 92 (should (secrets-open-session))
93
94 ;; There must be at least the collections "Login" and "session".
95 (should (or (member "Login" (secrets-list-collections))
96 (member "login" (secrets-list-collections))))
97 (should (member "session" (secrets-list-collections))) 93 (should (member "session" (secrets-list-collections)))
98 94
99 ;; Create a random collection. This asks for a password 95 ;; Create a random collection. This asks for a password
@@ -160,9 +156,6 @@
160 156
161 ;; There shall be no items in the "session" collection. 157 ;; There shall be no items in the "session" collection.
162 (should-not (secrets-list-items "session")) 158 (should-not (secrets-list-items "session"))
163 ;; There shall be items in the "Login" collection.
164 (should (or (secrets-list-items "Login")
165 (secrets-list-items "login")))
166 159
167 ;; Create a new item. 160 ;; Create a new item.
168 (should (setq item-path (secrets-create-item "session" "foo" "secret"))) 161 (should (setq item-path (secrets-create-item "session" "foo" "secret")))
diff --git a/test/lisp/progmodes/ruby-mode-tests.el b/test/lisp/progmodes/ruby-mode-tests.el
index 72d83affaef..afd6d65c9d1 100644
--- a/test/lisp/progmodes/ruby-mode-tests.el
+++ b/test/lisp/progmodes/ruby-mode-tests.el
@@ -718,6 +718,96 @@ VALUES-PLIST is a list with alternating index and value elements."
718 (ruby-backward-sexp) 718 (ruby-backward-sexp)
719 (should (= 2 (line-number-at-pos))))) 719 (should (= 2 (line-number-at-pos)))))
720 720
721(ert-deftest ruby-forward-sexp-jumps-do-end-block-with-no-args ()
722 (ruby-with-temp-buffer
723 (ruby-test-string
724 "proc do
725 |end")
726 (search-backward "do\n")
727 (ruby-forward-sexp)
728 (should (eobp))))
729
730(ert-deftest ruby-backward-sexp-jumps-do-end-block-with-no-args ()
731 (ruby-with-temp-buffer
732 (ruby-test-string
733 "proc do
734 |end")
735 (goto-char (point-max))
736 (ruby-backward-sexp)
737 (should (looking-at "do$"))))
738
739(ert-deftest ruby-forward-sexp-jumps-do-end-block-with-empty-args ()
740 (ruby-with-temp-buffer
741 (ruby-test-string
742 "proc do ||
743 |end")
744 (search-backward "do ")
745 (ruby-forward-sexp)
746 (should (eobp))))
747
748(ert-deftest ruby-backward-sexp-jumps-do-end-block-with-empty-args ()
749 (ruby-with-temp-buffer
750 (ruby-test-string
751 "proc do ||
752 |end")
753 (goto-char (point-max))
754 (ruby-backward-sexp)
755 (should (looking-at "do "))))
756
757(ert-deftest ruby-forward-sexp-jumps-do-end-block-with-args ()
758 (ruby-with-temp-buffer
759 (ruby-test-string
760 "proc do |a,b|
761 |end")
762 (search-backward "do ")
763 (ruby-forward-sexp)
764 (should (eobp))))
765
766(ert-deftest ruby-backward-sexp-jumps-do-end-block-with-args ()
767 (ruby-with-temp-buffer
768 (ruby-test-string
769 "proc do |a,b|
770 |end")
771 (goto-char (point-max))
772 (ruby-backward-sexp)
773 (should (looking-at "do "))))
774
775(ert-deftest ruby-forward-sexp-jumps-do-end-block-with-any-args ()
776 (ruby-with-temp-buffer
777 (ruby-test-string
778 "proc do |*|
779 |end")
780 (search-backward "do ")
781 (ruby-forward-sexp)
782 (should (eobp))))
783
784(ert-deftest ruby-forward-sexp-jumps-do-end-block-with-expanded-one-arg ()
785 (ruby-with-temp-buffer
786 (ruby-test-string
787 "proc do |a,|
788 |end")
789 (search-backward "do ")
790 (ruby-forward-sexp)
791 (should (eobp))))
792
793(ert-deftest ruby-forward-sexp-jumps-do-end-block-with-one-and-any-args ()
794 (ruby-with-temp-buffer
795 (ruby-test-string
796 "proc do |a,*|
797 |end")
798 (search-backward "do ")
799 (ruby-forward-sexp)
800 (should (eobp))))
801
802(ert-deftest ruby-backward-sexp-jumps-do-end-block-with-one-and-any-args ()
803 (ruby-with-temp-buffer
804 (ruby-test-string
805 "proc do |a,*|
806 |end")
807 (goto-char (point-max))
808 (ruby-backward-sexp)
809 (should (looking-at "do "))))
810
721(ert-deftest ruby-toggle-string-quotes-quotes-correctly () 811(ert-deftest ruby-toggle-string-quotes-quotes-correctly ()
722 (let ((pairs 812 (let ((pairs
723 '(("puts '\"foo\"\\''" . "puts \"\\\"foo\\\"'\"") 813 '(("puts '\"foo\"\\''" . "puts \"\\\"foo\\\"'\"")