diff options
| author | Daniel Colascione | 2014-04-07 13:54:16 -0700 |
|---|---|---|
| committer | Daniel Colascione | 2014-04-07 13:54:16 -0700 |
| commit | 7e31acf6b81fdce7258077645bc239767c484841 (patch) | |
| tree | 1f0d7b063a19b54982550797df063e0a9f87eaed /test | |
| parent | 608a4502b9fa8f5681368657fba5d5fd0fa46817 (diff) | |
| parent | e3b838807bf9fbbbec9826de6c1e4efdf72acb78 (diff) | |
| download | emacs-7e31acf6b81fdce7258077645bc239767c484841.tar.gz emacs-7e31acf6b81fdce7258077645bc239767c484841.zip | |
Merge from emacs-24; up to 2014-04-01T20:18:12Z!eggert@cs.ucla.edu
Diffstat (limited to 'test')
| -rw-r--r-- | test/ChangeLog | 25 | ||||
| -rw-r--r-- | test/automated/electric-tests.el | 29 | ||||
| -rw-r--r-- | test/automated/python-tests.el | 39 | ||||
| -rwxr-xr-x | test/indent/perl.perl | 4 |
4 files changed, 95 insertions, 2 deletions
diff --git a/test/ChangeLog b/test/ChangeLog index 4b1e352051b..2ef22c9a4c6 100644 --- a/test/ChangeLog +++ b/test/ChangeLog | |||
| @@ -1,3 +1,28 @@ | |||
| 1 | 2014-04-07 João Távora <joaotavora@gmail.com> | ||
| 2 | |||
| 3 | * automated/electric-tests.el (define-electric-pair-test): Don't | ||
| 4 | overtest.. | ||
| 5 | (inhibit-in-mismatched-string-inside-ruby-comments): New test. | ||
| 6 | (inhibit-in-mismatched-string-inside-c-comments): New test. | ||
| 7 | |||
| 8 | 2014-04-07 João Távora <joaotavora@gmail.com> | ||
| 9 | |||
| 10 | * automated/electric-tests.el (inhibit-if-strings-mismatched): | ||
| 11 | New test, change from `inhibit-only-of-next-is-mismatched'. | ||
| 12 | |||
| 13 | 2014-04-06 João Távora <joaotavora@gmail.com> | ||
| 14 | |||
| 15 | * automated/python-tests.el (python-triple-quote-pairing): New test. | ||
| 16 | (python-syntax-after-python-backspace): New test. | ||
| 17 | |||
| 18 | 2014-04-06 João Távora <joaotavora@gmail.com> | ||
| 19 | |||
| 20 | * automated/electric-tests.el (electric-pair-define-test-form): | ||
| 21 | More readable test docstrings. | ||
| 22 | (whitespace-skipping-for-quotes-not-ouside) | ||
| 23 | (whitespace-skipping-for-quotes-only-inside) | ||
| 24 | (whitespace-skipping-for-quotes-in-text-mode): New tests. | ||
| 25 | |||
| 1 | 2014-04-04 João Távora <joaotavora@gmail.com> | 26 | 2014-04-04 João Távora <joaotavora@gmail.com> |
| 2 | 27 | ||
| 3 | * automated/electric-tests.el (define-electric-pair-test): Don't | 28 | * automated/electric-tests.el (define-electric-pair-test): Don't |
diff --git a/test/automated/electric-tests.el b/test/automated/electric-tests.el index 9f0973e16b3..bcef9cc2adb 100644 --- a/test/automated/electric-tests.el +++ b/test/automated/electric-tests.el | |||
| @@ -114,8 +114,8 @@ | |||
| 114 | mode | 114 | mode |
| 115 | extra-desc)) | 115 | extra-desc)) |
| 116 | () | 116 | () |
| 117 | ,(format "With \"%s\", try input %c at point %d. \ | 117 | ,(format "With |%s|, try input %c at point %d. \ |
| 118 | Should %s \"%s\" and point at %d" | 118 | Should %s |%s| and point at %d" |
| 119 | fixture | 119 | fixture |
| 120 | char | 120 | char |
| 121 | (1+ pos) | 121 | (1+ pos) |
| @@ -383,6 +383,31 @@ baz\"\"" | |||
| 383 | :test-in-code nil | 383 | :test-in-code nil |
| 384 | :test-in-comments t) | 384 | :test-in-comments t) |
| 385 | 385 | ||
| 386 | (define-electric-pair-test whitespace-skipping-for-quotes-not-ouside | ||
| 387 | " \" \"" "\"-----" :expected-string "\"\" \" \"" | ||
| 388 | :expected-point 2 | ||
| 389 | :bindings '((electric-pair-skip-whitespace . chomp)) | ||
| 390 | :test-in-strings nil | ||
| 391 | :test-in-code t | ||
| 392 | :test-in-comments nil) | ||
| 393 | |||
| 394 | (define-electric-pair-test whitespace-skipping-for-quotes-only-inside | ||
| 395 | " \" \"" "---\"--" :expected-string " \"\"" | ||
| 396 | :expected-point 5 | ||
| 397 | :bindings '((electric-pair-skip-whitespace . chomp)) | ||
| 398 | :test-in-strings nil | ||
| 399 | :test-in-code t | ||
| 400 | :test-in-comments nil) | ||
| 401 | |||
| 402 | (define-electric-pair-test whitespace-skipping-quotes-not-without-proper-syntax | ||
| 403 | " \" \"" "---\"--" :expected-string " \"\"\" \"" | ||
| 404 | :expected-point 5 | ||
| 405 | :modes '(text-mode) | ||
| 406 | :bindings '((electric-pair-skip-whitespace . chomp)) | ||
| 407 | :test-in-strings nil | ||
| 408 | :test-in-code t | ||
| 409 | :test-in-comments nil) | ||
| 410 | |||
| 386 | 411 | ||
| 387 | ;;; Pairing arbitrary characters | 412 | ;;; Pairing arbitrary characters |
| 388 | ;;; | 413 | ;;; |
diff --git a/test/automated/python-tests.el b/test/automated/python-tests.el index dc58138ced4..8fe8f71264f 100644 --- a/test/automated/python-tests.el +++ b/test/automated/python-tests.el | |||
| @@ -134,6 +134,16 @@ aliqua." | |||
| 134 | 134 | ||
| 135 | ;;; Font-lock and syntax | 135 | ;;; Font-lock and syntax |
| 136 | 136 | ||
| 137 | (ert-deftest python-syntax-after-python-backspace () | ||
| 138 | ;; `python-indent-dedent-line-backspace' garbles syntax | ||
| 139 | :expected-result :failed | ||
| 140 | (python-tests-with-temp-buffer | ||
| 141 | "\"\"\"" | ||
| 142 | (goto-char (point-max)) | ||
| 143 | (python-indent-dedent-line-backspace 1) | ||
| 144 | (should (string= (buffer-string) "\"\"")) | ||
| 145 | (should (null (nth 3 (syntax-ppss)))))) | ||
| 146 | |||
| 137 | 147 | ||
| 138 | ;;; Indentation | 148 | ;;; Indentation |
| 139 | 149 | ||
| @@ -2696,6 +2706,9 @@ def foo(a, b, c): | |||
| 2696 | (equal (symbol-value (car ccons)) (cdr ccons))))) | 2706 | (equal (symbol-value (car ccons)) (cdr ccons))))) |
| 2697 | (kill-buffer buffer))) | 2707 | (kill-buffer buffer))) |
| 2698 | 2708 | ||
| 2709 | |||
| 2710 | ;;; Electricity | ||
| 2711 | |||
| 2699 | (ert-deftest python-util-forward-comment-1 () | 2712 | (ert-deftest python-util-forward-comment-1 () |
| 2700 | (python-tests-with-temp-buffer | 2713 | (python-tests-with-temp-buffer |
| 2701 | (concat | 2714 | (concat |
| @@ -2708,6 +2721,32 @@ def foo(a, b, c): | |||
| 2708 | (python-util-forward-comment -1) | 2721 | (python-util-forward-comment -1) |
| 2709 | (should (= (point) (point-min))))) | 2722 | (should (= (point) (point-min))))) |
| 2710 | 2723 | ||
| 2724 | (ert-deftest python-triple-quote-pairing () | ||
| 2725 | (python-tests-with-temp-buffer | ||
| 2726 | "\"\"\n" | ||
| 2727 | (goto-char (1- (point-max))) | ||
| 2728 | (let ((last-command-event ?\")) | ||
| 2729 | (call-interactively 'self-insert-command)) | ||
| 2730 | (should (string= (buffer-string) | ||
| 2731 | "\"\"\"\"\"\"\n")) | ||
| 2732 | (should (= (point) 4))) | ||
| 2733 | (python-tests-with-temp-buffer | ||
| 2734 | "\n" | ||
| 2735 | (let ((last-command-event ?\")) | ||
| 2736 | (dotimes (i 3) | ||
| 2737 | (call-interactively 'self-insert-command))) | ||
| 2738 | (should (string= (buffer-string) | ||
| 2739 | "\"\"\"\"\"\"\n")) | ||
| 2740 | (should (= (point) 4))) | ||
| 2741 | (python-tests-with-temp-buffer | ||
| 2742 | "\"\n\"\"\n" | ||
| 2743 | (goto-char (1- (point-max))) | ||
| 2744 | (let ((last-command-event ?\")) | ||
| 2745 | (call-interactively 'self-insert-command)) | ||
| 2746 | (should (= (point) (1- (point-max)))) | ||
| 2747 | (should (string= (buffer-string) | ||
| 2748 | "\"\n\"\"\"\n")))) | ||
| 2749 | |||
| 2711 | 2750 | ||
| 2712 | (provide 'python-tests) | 2751 | (provide 'python-tests) |
| 2713 | 2752 | ||
diff --git a/test/indent/perl.perl b/test/indent/perl.perl index 69c1f90c807..7cb877b0a95 100755 --- a/test/indent/perl.perl +++ b/test/indent/perl.perl | |||
| @@ -16,5 +16,9 @@ EOF1 | |||
| 16 | bar | 16 | bar |
| 17 | EOF2 | 17 | EOF2 |
| 18 | 18 | ||
| 19 | print $'; # This should not start a string! | ||
| 20 | |||
| 21 | print "hello" for /./; | ||
| 22 | |||
| 19 | $fileType_filesButNot # bug#12373? | 23 | $fileType_filesButNot # bug#12373? |
| 20 | = join( '|', map { quotemeta($_).'$' } @{$fileType->{filesButNot}} ); | 24 | = join( '|', map { quotemeta($_).'$' } @{$fileType->{filesButNot}} ); |