diff options
| author | Stefan Kangas | 2020-09-21 16:39:54 +0200 |
|---|---|---|
| committer | Stefan Kangas | 2020-09-21 16:46:21 +0200 |
| commit | d5d642eb71d8228d5a408a3d43ca1f4a5b500b9d (patch) | |
| tree | f36e5afc60fa842f099c5ad08c0a14c942cd4552 | |
| parent | 31cb935cd72ec915f3461f4517a8675e96b66ac5 (diff) | |
| download | emacs-d5d642eb71d8228d5a408a3d43ca1f4a5b500b9d.tar.gz emacs-d5d642eb71d8228d5a408a3d43ca1f4a5b500b9d.zip | |
Convert manual indent test for opascal-mode into unit test
* test/manual/indent/opascal.pas: Delete file.
* test/lisp/progmodes/opascal-tests.el: New file with unit test for
oposcal-mode based on deleted file.
| -rw-r--r-- | test/lisp/progmodes/opascal-tests.el | 45 | ||||
| -rw-r--r-- | test/manual/indent/opascal.pas | 12 |
2 files changed, 45 insertions, 12 deletions
diff --git a/test/lisp/progmodes/opascal-tests.el b/test/lisp/progmodes/opascal-tests.el new file mode 100644 index 00000000000..70a4ebfa70d --- /dev/null +++ b/test/lisp/progmodes/opascal-tests.el | |||
| @@ -0,0 +1,45 @@ | |||
| 1 | ;;; opascal-tests.el --- tests for opascal.el -*- lexical-binding: t -*- | ||
| 2 | |||
| 3 | ;; Copyright (C) 2020 Free Software Foundation, Inc. | ||
| 4 | |||
| 5 | ;; This file is part of GNU Emacs. | ||
| 6 | |||
| 7 | ;; GNU Emacs is free software: you can redistribute it and/or modify | ||
| 8 | ;; it under the terms of the GNU General Public License as published by | ||
| 9 | ;; the Free Software Foundation, either version 3 of the License, or | ||
| 10 | ;; (at your option) any later version. | ||
| 11 | |||
| 12 | ;; GNU Emacs is distributed in the hope that it will be useful, | ||
| 13 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | ;; GNU General Public License for more details. | ||
| 16 | |||
| 17 | ;; You should have received a copy of the GNU General Public License | ||
| 18 | ;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. | ||
| 19 | |||
| 20 | (require 'ert) | ||
| 21 | (require 'opascal) | ||
| 22 | |||
| 23 | (ert-deftest opascal-indent-bug-36348 () | ||
| 24 | (with-temp-buffer | ||
| 25 | (opascal-mode) | ||
| 26 | (let ((orig "{ -*- opascal -*- } | ||
| 27 | |||
| 28 | procedure Toto (); | ||
| 29 | begin | ||
| 30 | for i := 0 to 1 do | ||
| 31 | Write (str.Chars[i]); | ||
| 32 | |||
| 33 | // bug#36348 | ||
| 34 | for var i := 0 to 1 do | ||
| 35 | Write (str.Chars[i]); | ||
| 36 | |||
| 37 | end; | ||
| 38 | ")) | ||
| 39 | (insert orig) | ||
| 40 | (indent-region (point-min) (point-max)) | ||
| 41 | (should (equal (buffer-string) orig))))) | ||
| 42 | |||
| 43 | (provide 'opascal-tests) | ||
| 44 | |||
| 45 | ;;; opascal-tests.el ends here | ||
diff --git a/test/manual/indent/opascal.pas b/test/manual/indent/opascal.pas deleted file mode 100644 index ac4beb3f840..00000000000 --- a/test/manual/indent/opascal.pas +++ /dev/null | |||
| @@ -1,12 +0,0 @@ | |||
| 1 | { -*- opascal -*- } | ||
| 2 | |||
| 3 | procedure Toto (); | ||
| 4 | begin | ||
| 5 | for i := 0 to 1 do | ||
| 6 | Write (str.Chars[i]); | ||
| 7 | |||
| 8 | // bug#36348 | ||
| 9 | for var i := 0 to 1 do | ||
| 10 | Write (str.Chars[i]); | ||
| 11 | |||
| 12 | end; | ||