]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix print-tests
authorThuna <thuna.cing@gmail.com>
Wed, 12 Feb 2025 22:34:16 +0000 (23:34 +0100)
committerEshel Yaron <me@eshelyaron.com>
Sun, 23 Feb 2025 08:21:21 +0000 (09:21 +0100)
* test/src/print-tests.el (terpri): Erase the buffer *terpri-test*
before individual runs.  (Bug#72334)
(print-circle): Allow circular references with number greater than 9.

(cherry picked from commit 5f1d52c43b5eafeb4938d99c275e78c9155f4142)

test/src/print-tests.el

index ddee6d914a4db5deaf3a5e44f863708dfbdcf11e..1a04cf73f30a415238c647119cbcac1f206fef4d 100644 (file)
@@ -130,6 +130,7 @@ otherwise, use a different charset."
                      "abc\n")))
   (let ((standard-output
          (with-current-buffer (get-buffer-create "*terpri-test*")
+           (erase-buffer)
            (insert "--------")
            (point-max-marker))))
     (should     (terpri nil t))
@@ -338,7 +339,7 @@ otherwise, use a different charset."
 (print-tests--deftest print-circle ()
   (let ((x '(#1=(a . #1#) #1#)))
     (let ((print-circle nil))
-      (should (string-match "\\`((a . #[0-9]) (a . #[0-9]))\\'"
+      (should (string-match "\\`((a . #[0-9]+) (a . #[0-9]+))\\'"
                             (print-tests--prin1-to-string x))))
     (let ((print-circle t))
       (should (equal "(#1=(a . #1#) #1#)" (print-tests--prin1-to-string x))))))