diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/automated/advice-tests.el | 23 | ||||
| -rwxr-xr-x | test/indent/perl.perl | 13 | ||||
| -rw-r--r-- | test/indent/ruby.rb | 3 |
3 files changed, 38 insertions, 1 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/indent/perl.perl b/test/indent/perl.perl index c7a2fbfb2d2..aca478a1375 100755 --- a/test/indent/perl.perl +++ b/test/indent/perl.perl | |||
| @@ -1,9 +1,20 @@ | |||
| 1 | #!/usr/bin/perl | 1 | #!/usr/bin/perl |
| 2 | # -*- eval: (bug-reference-mode 1) -*- | 2 | # -*- eval: (bug-reference-mode 1) -*- |
| 3 | 3 | ||
| 4 | use v5.14; | ||
| 5 | |||
| 6 | my $str= <<END; | ||
| 7 | Hello | ||
| 8 | END | ||
| 9 | |||
| 10 | my $a = $'; | ||
| 11 | |||
| 12 | my $b=3; | ||
| 13 | |||
| 14 | print $str; | ||
| 4 | if ($c && /====/){xyz;} | 15 | if ($c && /====/){xyz;} |
| 5 | 16 | ||
| 6 | print <<"EOF1" . s/he"llo/th'ere/; | 17 | print << "EOF1" . s/he"llo/th'ere/; |
| 7 | foo | 18 | foo |
| 8 | EOF2 | 19 | EOF2 |
| 9 | bar | 20 | bar |
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. |
| 20 | x = # "tot %q/to"; = | 23 | x = # "tot %q/to"; = |
| 21 | y = 2 / 3 | 24 | y = 2 / 3 |