]> code.delx.au - gnu-emacs/blobdiff - test/automated/viper-tests.el
; Only load .elc file in tests.
[gnu-emacs] / test / automated / viper-tests.el
index 1be92a4e1f6584a5249be4df42d9624e585aafe5..0d6095b2c9229d7ed84c8db03c59f7b6bef3310f 100644 (file)
@@ -4,18 +4,18 @@
 
 ;; This file is part of GNU Emacs.
 
-;; This program is free software: you can redistribute it and/or
-;; modify it under the terms of the GNU General Public License as
-;; published by the Free Software Foundation, either version 3 of the
-;; License, or (at your option) any later version.
-;;
-;; This program is distributed in the hope that it will be useful, but
-;; WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-;; General Public License for more details.
-;;
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
 ;; You should have received a copy of the GNU General Public License
-;; along with this program.  If not, see `http://www.gnu.org/licenses/'.
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
 ;;; Commentary:
 
@@ -33,16 +33,16 @@ after itself, although it will leave a buffer called
   (let (
         ;; Viper just turns itself off during batch use.
         (noninteractive nil)
-        ;; Switch off start up message or it will chew the key presses
+        ;; Switch off start up message or it will chew the key presses.
         (viper-inhibit-startup-message 't)
         ;; Select an expert-level for the same reason.
         (viper-expert-level 5)
         ;; viper loads this even with -q so make sure it's empty!
-        (viper-custom-file-name (make-temp-file "viper-tests"))
+        (viper-custom-file-name (make-temp-file "viper-tests" nil ".elc"))
         (before-buffer (current-buffer)))
     (unwind-protect
         (progn
-          ;; viper-mode is essentially global, so set it here
+          ;; viper-mode is essentially global, so set it here.
           (viper-mode)
           ;; We must switch to buffer because we are using a keyboard macro
           ;; which appears to not go to the current-buffer but what ever is
@@ -54,17 +54,18 @@ after itself, although it will leave a buffer called
           (erase-buffer)
           ;; The new buffer fails to enter vi state so set it.
           (viper-change-state-to-vi)
-          ;; Run the macro
+          ;; Run the macro.
           (execute-kbd-macro kmacro)
           (let ((rtn
                  (buffer-substring-no-properties
                   (point-min)
                   (point-max))))
-            ;; Kill the buffer iff the macro succeeds
+            ;; Kill the buffer iff the macro succeeds.
             (kill-buffer)
             rtn))
-      ;; switch everthing off and restore the buffer
+      ;; Switch everything off and restore the buffer.
       (toggle-viper-mode)
+      (delete-file viper-custom-file-name)
       (switch-to-buffer before-buffer))))
 
 (ert-deftest viper-test-go ()