summaryrefslogtreecommitdiff
path: root/test/lisp
diff options
context:
space:
mode:
authorStephen Leake <stephen_leake@stephe-leake.org>2018-12-13 14:39:02 -0800
committerStephen Leake <stephen_leake@stephe-leake.org>2018-12-13 14:39:02 -0800
commit87bef630bf0f45e8da74e43ba614aa2292b296ef (patch)
treeefdead3c0d7dd227bacbd4dfc5c1ff9b4d5c13c3 /test/lisp
parent4d3f7b77cc7dea072d2ecb9f137c2e497bc52da1 (diff)
parentd08b75abe0f0cf9ade812b189c374809a2c7836e (diff)
downloademacs-87bef630bf0f45e8da74e43ba614aa2292b296ef.tar.gz
Merge commit 'd08b75abe0f0cf9ade812b189c374809a2c7836e'
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 @@
(ert-deftest em-ls-test-bug27844 ()
"Test for https://debbugs.gnu.org/27844 ."
+ ;; FIXME: it would be better to use something other than source-directory
+ ;; in this test.
+ (skip-unless (and source-directory
+ (file-exists-p
+ (expand-file-name "lisp/subr.el" source-directory))))
(let ((orig eshell-ls-use-in-dired)
(dired-use-ls-dired 'unspecified)
buf insert-directory-program)
@@ -89,6 +94,15 @@
(should (cdr (dired-get-marked-files)))
(kill-buffer buf)
(setq buf (dired (expand-file-name "lisp/subr.el" source-directory)))
+ (when (getenv "EMACS_HYDRA_CI")
+ (message "X1%s" (buffer-substring-no-properties
+ (point-min) (point-max)))
+ (message "X2%s" (buffer-substring-no-properties
+ (line-beginning-position)
+ (line-end-position)))
+ (message "X3%s" (buffer-substring-no-properties
+ (point)
+ (line-end-position))))
(should (looking-at "subr\\.el")))
(customize-set-variable 'eshell-ls-use-in-dired orig)
(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 @@
(unwind-protect
(progn
(should (secrets-open-session))
-
- ;; There must be at least the collections "Login" and "session".
- (should (or (member "Login" (secrets-list-collections))
- (member "login" (secrets-list-collections))))
(should (member "session" (secrets-list-collections)))
;; Create a random collection. This asks for a password
@@ -160,9 +156,6 @@
;; There shall be no items in the "session" collection.
(should-not (secrets-list-items "session"))
- ;; There shall be items in the "Login" collection.
- (should (or (secrets-list-items "Login")
- (secrets-list-items "login")))
;; Create a new item.
(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."
(ruby-backward-sexp)
(should (= 2 (line-number-at-pos)))))
+(ert-deftest ruby-forward-sexp-jumps-do-end-block-with-no-args ()
+ (ruby-with-temp-buffer
+ (ruby-test-string
+ "proc do
+ |end")
+ (search-backward "do\n")
+ (ruby-forward-sexp)
+ (should (eobp))))
+
+(ert-deftest ruby-backward-sexp-jumps-do-end-block-with-no-args ()
+ (ruby-with-temp-buffer
+ (ruby-test-string
+ "proc do
+ |end")
+ (goto-char (point-max))
+ (ruby-backward-sexp)
+ (should (looking-at "do$"))))
+
+(ert-deftest ruby-forward-sexp-jumps-do-end-block-with-empty-args ()
+ (ruby-with-temp-buffer
+ (ruby-test-string
+ "proc do ||
+ |end")
+ (search-backward "do ")
+ (ruby-forward-sexp)
+ (should (eobp))))
+
+(ert-deftest ruby-backward-sexp-jumps-do-end-block-with-empty-args ()
+ (ruby-with-temp-buffer
+ (ruby-test-string
+ "proc do ||
+ |end")
+ (goto-char (point-max))
+ (ruby-backward-sexp)
+ (should (looking-at "do "))))
+
+(ert-deftest ruby-forward-sexp-jumps-do-end-block-with-args ()
+ (ruby-with-temp-buffer
+ (ruby-test-string
+ "proc do |a,b|
+ |end")
+ (search-backward "do ")
+ (ruby-forward-sexp)
+ (should (eobp))))
+
+(ert-deftest ruby-backward-sexp-jumps-do-end-block-with-args ()
+ (ruby-with-temp-buffer
+ (ruby-test-string
+ "proc do |a,b|
+ |end")
+ (goto-char (point-max))
+ (ruby-backward-sexp)
+ (should (looking-at "do "))))
+
+(ert-deftest ruby-forward-sexp-jumps-do-end-block-with-any-args ()
+ (ruby-with-temp-buffer
+ (ruby-test-string
+ "proc do |*|
+ |end")
+ (search-backward "do ")
+ (ruby-forward-sexp)
+ (should (eobp))))
+
+(ert-deftest ruby-forward-sexp-jumps-do-end-block-with-expanded-one-arg ()
+ (ruby-with-temp-buffer
+ (ruby-test-string
+ "proc do |a,|
+ |end")
+ (search-backward "do ")
+ (ruby-forward-sexp)
+ (should (eobp))))
+
+(ert-deftest ruby-forward-sexp-jumps-do-end-block-with-one-and-any-args ()
+ (ruby-with-temp-buffer
+ (ruby-test-string
+ "proc do |a,*|
+ |end")
+ (search-backward "do ")
+ (ruby-forward-sexp)
+ (should (eobp))))
+
+(ert-deftest ruby-backward-sexp-jumps-do-end-block-with-one-and-any-args ()
+ (ruby-with-temp-buffer
+ (ruby-test-string
+ "proc do |a,*|
+ |end")
+ (goto-char (point-max))
+ (ruby-backward-sexp)
+ (should (looking-at "do "))))
+
(ert-deftest ruby-toggle-string-quotes-quotes-correctly ()
(let ((pairs
'(("puts '\"foo\"\\''" . "puts \"\\\"foo\\\"'\"")