diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/Makefile.in | 8 | ||||
-rw-r--r-- | test/lisp/eshell/em-ls-tests.el | 14 | ||||
-rw-r--r-- | test/lisp/net/secrets-tests.el | 7 | ||||
-rw-r--r-- | test/lisp/progmodes/ruby-mode-tests.el | 90 | ||||
-rw-r--r-- | test/src/fileio-tests.el | 4 |
5 files changed, 116 insertions, 7 deletions
diff --git a/test/Makefile.in b/test/Makefile.in index adb316c3d9c..4548323f26a 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -190,6 +190,12 @@ else maybe_exclude_module_tests := -name emacs-module-tests.el -prune -o endif +## Optional list of .el files to exclude from testing. +## Intended for use in automated testing where one or more files +## has some problem and needs to be excluded. +## To avoid writing full name, can use eg %foo-tests.el. +EXCLUDE_TESTS = + ## To speed up parallel builds, put these slow test files (which can ## take longer than all the rest combined) at the start of the list. SLOW_TESTS = ${srcdir}/lisp/net/tramp-tests.el @@ -202,6 +208,8 @@ ELFILES := $(sort $(shell find ${srcdir} -path "${srcdir}/manual" -prune -o \ $(foreach slow,${SLOW_TESTS},$(eval ELFILES:= ${slow} $(filter-out ${slow},${ELFILES}))) +$(foreach exclude,${EXCLUDE_TESTS},$(eval ELFILES:= $(filter-out ${exclude},${ELFILES}))) + ## .log files may be in a different directory for out of source builds LOGFILES := $(patsubst %.el,%.log, \ $(patsubst $(srcdir)/%,%,$(ELFILES))) 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\\\"'\"") diff --git a/test/src/fileio-tests.el b/test/src/fileio-tests.el index b7b78bbda09..a74bcea41f2 100644 --- a/test/src/fileio-tests.el +++ b/test/src/fileio-tests.el @@ -102,4 +102,8 @@ Also check that an encoding error can appear in a symlink." (setenv "HOME" "a/b/c") (should (equal (expand-file-name "~/foo") (expand-file-name "a/b/c/foo"))) + (when (memq system-type '(ms-dos windows-nt)) + ;; Test expansion of drive-relative file names. + (setenv "HOME" "x:foo") + (should (equal (expand-file-name "~/bar") "x:/foo/bar"))) (setenv "HOME" old-home))) |