]> git.eshelyaron.com Git - emacs.git/commitdiff
Add more ps-mode octal tests
authorLars Ingebrigtsen <larsi@gnus.org>
Thu, 13 Jun 2019 01:03:26 +0000 (03:03 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Thu, 13 Jun 2019 01:03:26 +0000 (03:03 +0200)
* test/lisp/progmodes/ps-mode-tests.el
(ps-mode-test-octal-region-multibyte): New test.

test/lisp/progmodes/ps-mode-tests.el

index aa0c4f3a05927dc7644b1b1da03739cc6fcac215..9f157e022a1e888474a49813dbd04789135a5ece 100644 (file)
@@ -24,7 +24,7 @@
 (require 'ert)
 (require 'ps-mode)
 
-(ert-deftest ps-mode-test-octal-region ()
+(ert-deftest ps-mode-test-octal-region-unibyte ()
   (with-temp-buffer
     (set-buffer-multibyte nil)
     (insert "foo" #x90 #x91 #x92 "bar")
     (should (equal (buffer-string)
                    "foo\\220\\221\\222bar"))))
 
+(ert-deftest ps-mode-test-octal-region-multibyte ()
+  (with-temp-buffer
+    (insert "foo"
+            (unibyte-char-to-multibyte #x90)
+            (unibyte-char-to-multibyte #x91)
+            (unibyte-char-to-multibyte #x92)
+            "bar")
+    (ps-mode-octal-region (point-min) (point-max))
+    (should (equal (buffer-string)
+                   "foo\\220\\221\\222bar"))))
+
 (provide 'ps-mode-tests)
 
 ;;; ps-mode-tests.el ends here