diff options
| author | Paul Eggert | 2017-11-08 19:22:26 -0800 |
|---|---|---|
| committer | Paul Eggert | 2017-11-08 19:22:26 -0800 |
| commit | 6ee827059463e4b95c9251ef22a21f9c67cf668d (patch) | |
| tree | 0612e1b84922cc43eeed5ea219104d4c5985cbdf /test | |
| parent | 83dc3f0e9b518e45bcfb0aaebcc706f79622f157 (diff) | |
| parent | 255ba01148f69f452937e67feb7af5d4c1466fed (diff) | |
| download | emacs-6ee827059463e4b95c9251ef22a21f9c67cf668d.tar.gz emacs-6ee827059463e4b95c9251ef22a21f9c67cf668d.zip | |
Merge from origin/emacs-26
255ba01148 Fix handling of nil PRED2 arg for completion-table-with-pr...
949b70a7d8 ; Minor comment copyedit in window.c
20f9bf30f0 Describe Lao rendering problem
3d61657694 Fix docstring of arabic-shaper-ZWNJ-handling
db949166ec Handle single-line comments correctly (Bug#26049)
795bb233a5 * test/lisp/net/tramp-tests.el (tramp-test16-file-expand-w...
ba00ea7d0d * etc/PROBLEMS: Add URL to relevant issues for xterm+evil bug
4a6015811e ; In text.texi fix typo spotted by Štěpán Němec
93cd8415b2 Document new treatment of 'comment-auto-fill-only-comments'
ca2d94ba61 Do not load Tramp unless `tramp-mode' is non-nil
709478eaa8 Prefer `customize-set-variable' in tramp.texi
5d36f2227f Fix last change in hscroll_window_tree
72d07d1950 Ediff: add some missing documentation
18af404ef3 Support python virtualenv on w32 (Bug#24464)
efd0371c23 Improve dired deletion error handling (Bug#28797)
5d744e032f Don't replace user input when completion prefix is empty (...
ec6cf35c5f ; Describe xt-mouse problems with Evil mode
c572e1f329 Return non-nil from gnutls-available-p under GnuTLS 2.x
a2cc6d74c5 Fix Flymake help-echo functions across windows (bug#29142)
58bb3462ee Add tests for Flymake backends for Ruby and Perl
58e742b21d Add a Flymake backend for Perl
9dee764165 Add a Flymake backend for Ruby
3ad712ebc9 Add a Flymake backend for Python (bug#28808)
8db2b3a79b Allow "%" in Tramp host names
8c50842790 ; Fix typo in test/file-organization.org
00fa4449cd ; Fix typo
918a2dda07 Use hybrid malloc for FreeBSD (Bug#28308)
725ab635d9 Add html-, mhtml- and python-mode support to semantic symref
369da28702 Improve documentation of 'window-scroll-functions'
93818eed8a Fix subtle problems in tabulated-list-mode with line numbers
1f1de8e872 Make gdb-non-stop-setting default to nil on MS-Windows
680e8e119b Fix gdb-mi prompt after "attach PID" command
ff33074546 Fix doc string of 'window-configuration-change-hook'
787b75ad71 Improve documentation of window hooks
d9be8704ae Fix hscroll suspension after cursor motion
6f43d29d29 ; * CONTRIBUTE, admin/make-tarball.txt: Doc tweaks re 'ema...
a0d30d6369 Introduce a function to CC Mode which displays the current...
383abc8898 ; Fix some comment typos
b02c2714c3 Fix typos in ediff-wind.el
4f38bdec74 Examine tex-chktex--process in the correct buffer
94b490529a * nt/INSTALL.W64: Update to current mingw64 install instru...
c25113d4ac Don't resignal errors in flymake-diag-region
e950f329c0 New xref-quit-and-goto-xref command bound to TAB (bug#28814)
5d34e1b288 Allow split-window-sensibly to split threshold in further ...
2a973edeac Honor window-switching intents in xref-find-definitions (b...
78e9065e9f * lisp/emacs-lisp/generator.el (iter-do): Add a debug decl...
caa63cc96c * lisp/progmodes/flymake.el (flymake-start): Fix dead buff...
9f4f130b79 Fix buffer name comparison in async shell-command
# Conflicts:
# etc/NEWS
# lisp/vc/ediff-wind.el
Diffstat (limited to 'test')
| -rw-r--r-- | test/file-organization.org | 2 | ||||
| -rw-r--r-- | test/lisp/minibuffer-tests.el | 32 | ||||
| -rw-r--r-- | test/lisp/net/tramp-tests.el | 32 | ||||
| -rw-r--r-- | test/lisp/progmodes/flymake-resources/test.pl | 2 | ||||
| -rw-r--r-- | test/lisp/progmodes/flymake-resources/test.rb | 5 | ||||
| -rw-r--r-- | test/lisp/progmodes/flymake-tests.el | 27 |
6 files changed, 71 insertions, 29 deletions
diff --git a/test/file-organization.org b/test/file-organization.org index 4d76c0068e3..6c93c28c8e1 100644 --- a/test/file-organization.org +++ b/test/file-organization.org | |||
| @@ -30,7 +30,7 @@ the directory structure of the source tree; so tests for files in the | |||
| 30 | 30 | ||
| 31 | Tests should normally reside in a file with ~-tests.el~ added to the | 31 | Tests should normally reside in a file with ~-tests.el~ added to the |
| 32 | base-name of the tested source file; hence ~ert.el~ is tested in | 32 | base-name of the tested source file; hence ~ert.el~ is tested in |
| 33 | ~ert-tests.el~, and ~pcase.el~ is tested in ~pcase-tests.el~. As n | 33 | ~ert-tests.el~, and ~pcase.el~ is tested in ~pcase-tests.el~. As an |
| 34 | exception, tests for a single feature may be placed into multiple | 34 | exception, tests for a single feature may be placed into multiple |
| 35 | files of any name which are themselves placed in a directory named | 35 | files of any name which are themselves placed in a directory named |
| 36 | after the feature with ~-tests~ appended, such as | 36 | after the feature with ~-tests~ appended, such as |
diff --git a/test/lisp/minibuffer-tests.el b/test/lisp/minibuffer-tests.el index c27b338f7f3..2d2ac85e3ff 100644 --- a/test/lisp/minibuffer-tests.el +++ b/test/lisp/minibuffer-tests.el | |||
| @@ -42,5 +42,37 @@ | |||
| 42 | (should (equal (buffer-string) | 42 | (should (equal (buffer-string) |
| 43 | "test: ")))))) | 43 | "test: ")))))) |
| 44 | 44 | ||
| 45 | (ert-deftest completion-table-with-predicate-test () | ||
| 46 | (let ((full-collection | ||
| 47 | '("apple" ; Has A. | ||
| 48 | "beet" ; Has B. | ||
| 49 | "banana" ; Has A & B. | ||
| 50 | "cherry" ; Has neither. | ||
| 51 | )) | ||
| 52 | (no-A (lambda (x) (not (string-match-p "a" x)))) | ||
| 53 | (no-B (lambda (x) (not (string-match-p "b" x))))) | ||
| 54 | (should | ||
| 55 | (member "cherry" | ||
| 56 | (completion-table-with-predicate | ||
| 57 | full-collection no-A t "" no-B t))) | ||
| 58 | (should-not | ||
| 59 | (member "banana" | ||
| 60 | (completion-table-with-predicate | ||
| 61 | full-collection no-A t "" no-B t))) | ||
| 62 | ;; "apple" should still match when strict is nil. | ||
| 63 | (should (eq t (try-completion | ||
| 64 | "apple" | ||
| 65 | (apply-partially | ||
| 66 | 'completion-table-with-predicate | ||
| 67 | full-collection no-A nil) | ||
| 68 | no-B))) | ||
| 69 | ;; "apple" should still match when strict is nil and pred2 is nil | ||
| 70 | ;; (Bug#27841). | ||
| 71 | (should (eq t (try-completion | ||
| 72 | "apple" | ||
| 73 | (apply-partially | ||
| 74 | 'completion-table-with-predicate | ||
| 75 | full-collection no-A nil)))))) | ||
| 76 | |||
| 45 | (provide 'completion-tests) | 77 | (provide 'completion-tests) |
| 46 | ;;; completion-tests.el ends here | 78 | ;;; completion-tests.el ends here |
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index af707f85007..5a7134f5f53 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el | |||
| @@ -2290,7 +2290,7 @@ This tests also `file-directory-p' and `file-accessible-directory-p'." | |||
| 2290 | 2290 | ||
| 2291 | ;; Cleanup. | 2291 | ;; Cleanup. |
| 2292 | (ignore-errors | 2292 | (ignore-errors |
| 2293 | (delete-directory tmp-name1)))))) | 2293 | (delete-directory tmp-name1 'recursive)))))) |
| 2294 | 2294 | ||
| 2295 | (ert-deftest tramp-test17-insert-directory () | 2295 | (ert-deftest tramp-test17-insert-directory () |
| 2296 | "Check `insert-directory'." | 2296 | "Check `insert-directory'." |
| @@ -4432,23 +4432,27 @@ process sentinels. They shall not disturb each other." | |||
| 4432 | "Check that Tramp is loaded lazily, only when needed." | 4432 | "Check that Tramp is loaded lazily, only when needed." |
| 4433 | ;; Tramp is neither loaded at Emacs startup, nor when completing a | 4433 | ;; Tramp is neither loaded at Emacs startup, nor when completing a |
| 4434 | ;; non-Tramp file name like "/foo". Completing a Tramp-alike file | 4434 | ;; non-Tramp file name like "/foo". Completing a Tramp-alike file |
| 4435 | ;; name like "/foo:" autoloads Tramp. | 4435 | ;; name like "/foo:" autoloads Tramp, when `tramp-mode' is t. |
| 4436 | (let ((code | 4436 | (let ((code |
| 4437 | "(progn \ | 4437 | "(progn \ |
| 4438 | (message \"Tramp loaded: %s\" (featurep 'tramp)) \ | 4438 | (setq tramp-mode %s) \ |
| 4439 | (message \"Tramp loaded: %%s\" (featurep 'tramp)) \ | ||
| 4439 | (file-name-all-completions \"/foo\" \"/\") \ | 4440 | (file-name-all-completions \"/foo\" \"/\") \ |
| 4440 | (message \"Tramp loaded: %s\" (featurep 'tramp)) \ | 4441 | (message \"Tramp loaded: %%s\" (featurep 'tramp)) \ |
| 4441 | (file-name-all-completions \"/foo:\" \"/\") \ | 4442 | (file-name-all-completions \"/foo:\" \"/\") \ |
| 4442 | (message \"Tramp loaded: %s\" (featurep 'tramp)))")) | 4443 | (message \"Tramp loaded: %%s\" (featurep 'tramp)))")) |
| 4443 | (should | 4444 | (dolist (tm '(t nil)) |
| 4444 | (string-match | 4445 | (should |
| 4445 | "Tramp loaded: nil[\n\r]+Tramp loaded: nil[\n\r]+Tramp loaded: t[\n\r]+" | 4446 | (string-match |
| 4446 | (shell-command-to-string | 4447 | (format |
| 4447 | (format | 4448 | "Tramp loaded: nil[\n\r]+Tramp loaded: nil[\n\r]+Tramp loaded: %s[\n\r]+" |
| 4448 | "%s -batch -Q -L %s --eval %s" | 4449 | tm) |
| 4449 | (expand-file-name invocation-name invocation-directory) | 4450 | (shell-command-to-string |
| 4450 | (mapconcat 'shell-quote-argument load-path " -L ") | 4451 | (format |
| 4451 | (shell-quote-argument code))))))) | 4452 | "%s -batch -Q -L %s --eval %s" |
| 4453 | (expand-file-name invocation-name invocation-directory) | ||
| 4454 | (mapconcat 'shell-quote-argument load-path " -L ") | ||
| 4455 | (shell-quote-argument (format code tm))))))))) | ||
| 4452 | 4456 | ||
| 4453 | (ert-deftest tramp-test43-unload () | 4457 | (ert-deftest tramp-test43-unload () |
| 4454 | "Check that Tramp and its subpackages unload completely. | 4458 | "Check that Tramp and its subpackages unload completely. |
diff --git a/test/lisp/progmodes/flymake-resources/test.pl b/test/lisp/progmodes/flymake-resources/test.pl index d5abcb47e7f..6f4f1ccef50 100644 --- a/test/lisp/progmodes/flymake-resources/test.pl +++ b/test/lisp/progmodes/flymake-resources/test.pl | |||
| @@ -1,2 +1,4 @@ | |||
| 1 | @arr = [1,2,3,4]; | 1 | @arr = [1,2,3,4]; |
| 2 | unknown; | ||
| 2 | my $b = @arr[1]; | 3 | my $b = @arr[1]; |
| 4 | [ | ||
diff --git a/test/lisp/progmodes/flymake-resources/test.rb b/test/lisp/progmodes/flymake-resources/test.rb new file mode 100644 index 00000000000..1419eaf3ad2 --- /dev/null +++ b/test/lisp/progmodes/flymake-resources/test.rb | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | def bla | ||
| 2 | return 2 | ||
| 3 | print "not reached" | ||
| 4 | something | ||
| 5 | oops | ||
diff --git a/test/lisp/progmodes/flymake-tests.el b/test/lisp/progmodes/flymake-tests.el index cfa810053ca..c60f9100345 100644 --- a/test/lisp/progmodes/flymake-tests.el +++ b/test/lisp/progmodes/flymake-tests.el | |||
| @@ -108,24 +108,23 @@ SEVERITY-PREDICATE is used to setup | |||
| 108 | (should (eq 'flymake-warning | 108 | (should (eq 'flymake-warning |
| 109 | (face-at-point))))) | 109 | (face-at-point))))) |
| 110 | 110 | ||
| 111 | (ert-deftest warning-predicate-rx-perl () | 111 | (ert-deftest perl-backend () |
| 112 | "Test perl warning via regular expression predicate." | 112 | "Test the perl backend" |
| 113 | (skip-unless (executable-find "perl")) | 113 | (skip-unless (executable-find "perl")) |
| 114 | (flymake-tests--with-flymake | 114 | (flymake-tests--with-flymake ("test.pl") |
| 115 | ("test.pl" :severity-predicate "^Scalar value") | ||
| 116 | (flymake-goto-next-error) | 115 | (flymake-goto-next-error) |
| 117 | (should (eq 'flymake-warning | 116 | (should (eq 'flymake-warning (face-at-point))) |
| 118 | (face-at-point))))) | 117 | (flymake-goto-next-error) |
| 118 | (should (eq 'flymake-error (face-at-point))))) | ||
| 119 | 119 | ||
| 120 | (ert-deftest warning-predicate-function-perl () | 120 | (ert-deftest ruby-backend () |
| 121 | "Test perl warning via function predicate." | 121 | "Test the ruby backend" |
| 122 | (skip-unless (executable-find "perl")) | 122 | (skip-unless (executable-find "ruby")) |
| 123 | (flymake-tests--with-flymake | 123 | (flymake-tests--with-flymake ("test.rb") |
| 124 | ("test.pl" :severity-predicate | ||
| 125 | (lambda (msg) (string-match "^Scalar value" msg))) | ||
| 126 | (flymake-goto-next-error) | 124 | (flymake-goto-next-error) |
| 127 | (should (eq 'flymake-warning | 125 | (should (eq 'flymake-warning (face-at-point))) |
| 128 | (face-at-point))))) | 126 | (flymake-goto-next-error) |
| 127 | (should (eq 'flymake-error (face-at-point))))) | ||
| 129 | 128 | ||
| 130 | (ert-deftest different-diagnostic-types () | 129 | (ert-deftest different-diagnostic-types () |
| 131 | "Test GCC warning via function predicate." | 130 | "Test GCC warning via function predicate." |