]> git.eshelyaron.com Git - emacs.git/commitdiff
Convert manual indent test for ps-mode into unit test
authorStefan Kangas <stefan@marxist.se>
Mon, 21 Sep 2020 15:19:48 +0000 (17:19 +0200)
committerStefan Kangas <stefan@marxist.se>
Mon, 21 Sep 2020 16:47:55 +0000 (18:47 +0200)
* test/manual/indent/ps-mode.ps: Delete file.
* test/lisp/progmodes/ps-mode-tests.el (ps-mode-test-indent):
New unit test based on deleted file.

test/lisp/progmodes/ps-mode-tests.el
test/manual/indent/ps-mode.ps [deleted file]

index d565b321fdde7be794074b4276eb4d0c6e4f7995..eedf3f700912c2d8a1c8d940711836ea4ed19fe2 100644 (file)
     (should (equal (buffer-string)
                    "foo\\220\\221\\222bar"))))
 
+(ert-deftest ps-mode-test-indent ()
+  ;; Converted from manual test.
+  (with-temp-buffer
+    (ps-mode)
+    ;; TODO: Should some of these be fontification tests as well?
+    (let ((orig "%!PS-2.0
+
+<< 23 45 >>                     %dictionary
+< 23 >                          %hex string
+<~a>a%a~>                       %base85 string
+(%)s
+(sf\(g>a)sdg)
+
+/foo {
+    <<
+       hello 2
+       3
+    >>
+} def
+"))
+      (insert orig)
+      (indent-region (point-min) (point-max))
+      (should (equal (buffer-string) orig)))))
+
 (provide 'ps-mode-tests)
 
 ;;; ps-mode-tests.el ends here
diff --git a/test/manual/indent/ps-mode.ps b/test/manual/indent/ps-mode.ps
deleted file mode 100644 (file)
index 4b4ee0f..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-%!PS-2.0
-
-<< 23 45 >>                     %dictionary
-< 23 >                          %hex string
-<~a>a%a~>                       %base85 string
-(%)s
-(sf\(g>a)sdg)
-
-/foo {
-    <<
-       hello 2
-       3
-    >>
-} def