aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorGlenn Morris2014-05-11 23:59:30 -0700
committerGlenn Morris2014-05-11 23:59:30 -0700
commitbbbabffe06d4c763534d5be92844c48a3f8746e2 (patch)
treea6fffb13638948223f3142e5209cbce57282fbbd /test
parentffd6d9c4d321e93e301f9cafd1fe054389898978 (diff)
parent96b894717caa773aa6d98ff57385f1c7537e8972 (diff)
downloademacs-bbbabffe06d4c763534d5be92844c48a3f8746e2.tar.gz
emacs-bbbabffe06d4c763534d5be92844c48a3f8746e2.zip
Merge from emacs-24; up to 2014-05-12T06:15:47Z!rgm@gnu.org
Diffstat (limited to 'test')
-rw-r--r--test/automated/advice-tests.el23
-rw-r--r--test/automated/vc-bzr.el15
-rwxr-xr-xtest/indent/perl.perl11
-rw-r--r--test/indent/ruby.rb3
4 files changed, 45 insertions, 7 deletions
diff --git a/test/automated/advice-tests.el b/test/automated/advice-tests.el
index f755e8defef..e0c3b40487e 100644
--- a/test/automated/advice-tests.el
+++ b/test/automated/advice-tests.el
@@ -179,6 +179,29 @@ function being an around advice."
179 (interactive "P") nil) 179 (interactive "P") nil)
180 (should (equal (interactive-form 'sm-test9) '(interactive "P")))) 180 (should (equal (interactive-form 'sm-test9) '(interactive "P"))))
181 181
182(ert-deftest advice-test-multiples ()
183 (let ((sm-test10 (lambda (a) (+ a 10)))
184 (sm-advice (lambda (x) (if (consp x) (list (* 5 (car x))) (* 4 x)))))
185 (should (equal (funcall sm-test10 5) 15))
186 (add-function :filter-args (var sm-test10) sm-advice)
187 (should (equal (funcall sm-test10 5) 35))
188 (add-function :filter-return (var sm-test10) sm-advice)
189 (should (equal (funcall sm-test10 5) 60))
190 ;; Make sure we can add multiple times the same function, under the
191 ;; condition that they have different `name' properties.
192 (add-function :filter-args (var sm-test10) sm-advice '((name . "args")))
193 (should (equal (funcall sm-test10 5) 140))
194 (remove-function (var sm-test10) "args")
195 (should (equal (funcall sm-test10 5) 60))
196 (add-function :filter-args (var sm-test10) sm-advice '((name . "args")))
197 (add-function :filter-return (var sm-test10) sm-advice '((name . "ret")))
198 (should (equal (funcall sm-test10 5) 560))
199 ;; Make sure that if we specify to remove a function that was added
200 ;; multiple times, they are all removed, rather than removing only some
201 ;; arbitrary subset of them.
202 (remove-function (var sm-test10) sm-advice)
203 (should (equal (funcall sm-test10 5) 15))))
204
182;; Local Variables: 205;; Local Variables:
183;; no-byte-compile: t 206;; no-byte-compile: t
184;; End: 207;; End:
diff --git a/test/automated/vc-bzr.el b/test/automated/vc-bzr.el
index 07e821064ca..4c16465d54b 100644
--- a/test/automated/vc-bzr.el
+++ b/test/automated/vc-bzr.el
@@ -33,17 +33,18 @@
33 (skip-unless (executable-find vc-bzr-program)) 33 (skip-unless (executable-find vc-bzr-program))
34 ;; Bzr wants to access HOME, e.g. to write ~/.bzr.log. 34 ;; Bzr wants to access HOME, e.g. to write ~/.bzr.log.
35 ;; This is a problem on hydra, where HOME is non-existent. 35 ;; This is a problem on hydra, where HOME is non-existent.
36 ;; You can disable logging with BZR_LOG=/dev/null, but then 36 ;; You can disable logging with BZR_LOG=/dev/null, but then some
37 ;; some commands (eg `bzr status') want to access ~/.bazaar, 37 ;; commands (eg `bzr status') want to access ~/.bazaar, and will
38 ;; and will abort if they cannot. I could not figure out how to 38 ;; abort if they cannot. I could not figure out how to stop bzr
39 ;; stop bzr doing that, so just set HOME to a tempir for the duration. 39 ;; doing that, so just give it a temporary homedir for the duration.
40 ;; http://bugs.launchpad.net/bzr/+bug/137407 ?
40 (let* ((homedir (make-temp-file "vc-bzr-test" t)) 41 (let* ((homedir (make-temp-file "vc-bzr-test" t))
41 (bzrdir (expand-file-name "bzr" homedir)) 42 (bzrdir (expand-file-name "bzr" homedir))
42 (ignored-dir (progn 43 (ignored-dir (progn
43 (make-directory bzrdir) 44 (make-directory bzrdir)
44 (expand-file-name "ignored-dir" bzrdir))) 45 (expand-file-name "ignored-dir" bzrdir)))
45 (default-directory (file-name-as-directory bzrdir)) 46 (default-directory (file-name-as-directory bzrdir))
46 (process-environment (cons (format "HOME=%s" homedir) 47 (process-environment (cons (format "BZR_HOME=%s" homedir)
47 process-environment))) 48 process-environment)))
48 (unwind-protect 49 (unwind-protect
49 (progn 50 (progn
@@ -79,7 +80,7 @@
79 (expand-file-name "subdir" bzrdir))) 80 (expand-file-name "subdir" bzrdir)))
80 (file (expand-file-name "file" bzrdir)) 81 (file (expand-file-name "file" bzrdir))
81 (default-directory (file-name-as-directory bzrdir)) 82 (default-directory (file-name-as-directory bzrdir))
82 (process-environment (cons (format "HOME=%s" homedir) 83 (process-environment (cons (format "BZR_HOME=%s" homedir)
83 process-environment))) 84 process-environment)))
84 (unwind-protect 85 (unwind-protect
85 (progn 86 (progn
@@ -120,7 +121,7 @@
120 (expand-file-name "foo.el" bzrdir))) 121 (expand-file-name "foo.el" bzrdir)))
121 (default-directory (file-name-as-directory bzrdir)) 122 (default-directory (file-name-as-directory bzrdir))
122 (generated-autoload-file (expand-file-name "loaddefs.el" bzrdir)) 123 (generated-autoload-file (expand-file-name "loaddefs.el" bzrdir))
123 (process-environment (cons (format "HOME=%s" homedir) 124 (process-environment (cons (format "BZR_HOME=%s" homedir)
124 process-environment))) 125 process-environment)))
125 (unwind-protect 126 (unwind-protect
126 (progn 127 (progn
diff --git a/test/indent/perl.perl b/test/indent/perl.perl
index 0bfcc98356b..34cd4af1125 100755
--- a/test/indent/perl.perl
+++ b/test/indent/perl.perl
@@ -1,6 +1,17 @@
1#!/usr/bin/perl 1#!/usr/bin/perl
2# -*- eval: (bug-reference-mode 1) -*- 2# -*- eval: (bug-reference-mode 1) -*-
3 3
4use v5.14;
5
6my $str= <<END;
7Hello
8END
9
10my $a = $';
11
12my $b=3;
13
14print $str;
4if ($c && /====/){xyz;} 15if ($c && /====/){xyz;}
5 16
6print "a" . <<EOF . s/he"llo/th'ere/; 17print "a" . <<EOF . s/he"llo/th'ere/;
diff --git a/test/indent/ruby.rb b/test/indent/ruby.rb
index fb341ee7ba6..7e778798996 100644
--- a/test/indent/ruby.rb
+++ b/test/indent/ruby.rb
@@ -16,6 +16,9 @@ d = %(hello (nested) world)
16# Don't propertize percent literals inside strings. 16# Don't propertize percent literals inside strings.
17"(%s, %s)" % [123, 456] 17"(%s, %s)" % [123, 456]
18 18
19"abc/#{def}ghi"
20"abc\#{def}ghi"
21
19# Or inside comments. 22# Or inside comments.
20x = # "tot %q/to"; = 23x = # "tot %q/to"; =
21 y = 2 / 3 24 y = 2 / 3