casouri / vundo

Visualize the undo tree.
469 stars 23 forks source link

Test `vundo-test--3` fails in emacs-29 #36

Closed ideasman42 closed 2 years ago

ideasman42 commented 2 years ago

emacs -batch -l ./vundo.el -l ./test/vundo-test.el -f ert-run-tests-batch-and-exit

Gives the following error in emacs-29 (9fab134ee8b4ed439a8944e0d7058b1898c9bc0b).

Running 7 tests (2022-04-04 10:15:43+1000, selector ‘t’)
Undo
   passed  1/7  vundo-test--1 (0.011325 sec)
   passed  2/7  vundo-test--2 (0.118555 sec)
Mark set
Undo
Test vundo-test--3 backtrace:
  ert-fail(((should (equal (vundo-test--buf-str-np) "acde")) :form (eq
  (if (unwind-protect (setq value-137 (apply fn-135 args-136)) (setq f
  (let (form-description-139) (if (unwind-protect (setq value-137 (app
  (let ((value-137 'ert-form-evaluation-aborted-138)) (let (form-descr
  (let* ((fn-135 #'equal) (args-136 (condition-case err (let ((signal-
  (let ((vundo-glyph-alist vundo-unicode-symbols)) (vundo-test--insert
  (progn (buffer-enable-undo) (let ((vundo-glyph-alist vundo-unicode-s
  (unwind-protect (progn (buffer-enable-undo) (let ((vundo-glyph-alist
  (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn
  (let ((temp-buffer (generate-new-buffer " *temp*" t))) (save-current
  (closure (t) nil (let ((temp-buffer (generate-new-buffer " *temp*" t
  ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test
  ert-run-test(#s(ert-test :name vundo-test--3 :documentation "This te
  ert-run-or-rerun-test(#s(ert--stats :selector t :tests [#s(ert-test
  ert-run-tests(t #f(compiled-function (event-type &rest event-args) #
  ert-run-tests-batch(nil)
  ert-run-tests-batch-and-exit()
  command-line-1(("-l" "./vundo.el" "-l" "./test/vundo-test.el" "-f" "
  command-line()
  normal-top-level()
Test vundo-test--3 condition:
    (ert-test-failed
     ((should
       (equal
        (vundo-test--buf-str-np)
        "acde"))
      :form
      (equal "abcd" "acde")
      :value nil :explanation
      (array-elt 1
                 (different-atoms
                  (98 "#x62" "?b")
                  (99 "#x63" "?c")))))
   FAILED  3/7  vundo-test--3 (0.000103 sec) at test/vundo-test.el:183
   passed  4/7  vundo-test--4 (1.562135 sec)
   passed  5/7  vundo-test--mod-list (0.000068 sec)
   passed  6/7  vundo-test--position-only-p (0.000032 sec)
   passed  7/7  vundo-test--skip-position-only (0.000027 sec)

Ran 7 tests, 6 results as expected, 1 unexpected (2022-04-04 10:15:44+1000, 1.789043 sec)

1 unexpected results:
   FAILED  vundo-test--3
casouri commented 2 years ago

I pulled the latest trunk at 74100997b3853a6c00c60e1998ed5a86a9a01bc3 and the tests seem to pass. Could you also pull trunk can test?

ideasman42 commented 2 years ago

Tested 74100997b3853a6c00c60e1998ed5a86a9a01bc3 as well as emacs-28.1 stable, both report this error for me.

I moved my user configuration (even though that shouldn't have been loading anyway), but the error persists.

casouri commented 2 years ago

Ah, I think I know why. I tried batch test and it errors too. But running an interactive session and M-x ert RET works fine. Test 3 is testing regional undo, so I guess region behaves differently in batch mode. The test result (expect "acde" got "abcd") also suggest that Emacs didn't do regional undo but did a global undo.

ideasman42 commented 2 years ago

Thanks, would be nice to resolve but this is more of a TODO/something to investigate.

casouri commented 2 years ago

BTW, I added a condition check that disables test 3 on batch mode. So you should be able to run batch test and pass now.