haskell / haskell-mode

Emacs mode for Haskell
http://haskell.github.io/haskell-mode/
GNU General Public License v3.0
1.33k stars 342 forks source link

haskell-indent-put-region-in-literate-2 test fails withe emacs 27.1 (release candidate) #1714

Open jackhill opened 4 years ago

jackhill commented 4 years ago

While testing haskell-mode with the Emacs 27.1 release candidate, the haskell-indent-put-region-in-literate-2 fails with the following log:

Making before-change-functions buffer-local while locally let-bound!
Test haskell-indent-put-region-in-literate-2 backtrace:
  signal(error ("Can’t find the comment end"))
  apply(signal (error ("Can’t find the comment end")))
  (setq value-1067 (apply fn-1065 args-1066))
  (unwind-protect (setq value-1067 (apply fn-1065 args-1066)) (setq fo
  (if (unwind-protect (setq value-1067 (apply fn-1065 args-1066)) (set
  (let (form-description-1069) (if (unwind-protect (setq value-1067 (a
  (let ((value-1067 'ert-form-evaluation-aborted-1068)) (let (form-des
  (let* ((fn-1065 #'equal) (args-1066 (condition-case err (let ((signa
  (closure (t) nil (let* ((fn-1065 #'equal) (args-1066 (condition-case
  ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test
  ert-run-test(#s(ert-test :name haskell-indent-put-region-in-literate
  ert-run-or-rerun-test(#s(ert--stats :selector t :tests ... :test-map
  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(("--eval" "(when (boundp 'load-prefer-newer) (setq lo
  command-line()
  normal-top-level()
Test haskell-indent-put-region-in-literate-2 condition:
    (error "Can’t find the comment end")
   FAILED  200/532  haskell-indent-put-region-in-literate-2 (0.000351 sec)

I observed this with both the the 17.1 release and commit 41683c0e634bb3f54eac8747919a82132e1714fe.

brettgilio commented 4 years ago

I can replicate this issue.

purcell commented 4 years ago

Same. Strangely, this passes with Emacs 27.1 in CI.

thkoch2001 commented 3 years ago

This also failed in a Debian build with emacs 27.1: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=973132

The test failure can be reproduced this way:

  1. Open a buffer with haskell-literate-mode
  2. Insert > indent in the buffer
  3. Execute (M-:) this lisp code copied from function haskell-indent-put-region-in-literate:
      (let ((comment-start "> ")        ; Change dynamic bindings for
            (comment-start-skip "^> ?") ; comment-region.
            (comment-end "")
            (comment-end-skip "\n")
            (comment-style 'plain))
        (comment-region (point-min) (point-max)  -1))

This gives:

Debugger entered--Lisp error: (error "Can’t find the comment end")
  signal(error ("Can’t find the comment end"))
  error("Can't find the comment end")
  uncomment-region-default-1(1 11 1)
  #f(compiled-function () #<bytecode 0x15662c75d4cd>)()
  combine-change-calls-1(1 11 #f(compiled-function () #<bytecode 0x15662c75d4cd>))
  uncomment-region-default(1 11 1)
  uncomment-region(1 11 1)
  comment-region-default-1(1 12 -1)
  #f(compiled-function () #<bytecode 0x15662c75d495>)()
  combine-change-calls-1(1 12 #f(compiled-function () #<bytecode 0x15662c75d495>))
  comment-region-default(1 12 -1)
  comment-region(1 12 -1)
  (let ((comment-start "> ") (comment-start-skip "^> ?") (comment-end "") (comment-end-skip "\n") (comment-style 'plain)) (comment-region (point-min) (point-max) -1))
  eval((let ((comment-start "> ") (comment-start-skip "^> ?") (comment-end "") (comment-end-skip "\n") (comment-style 'plain)) (comment-region (point-min) (point-max) -1)) t)
  eval-expression((let ((comment-start "> ") (comment-start-skip "^> ?") (comment-end "") (comment-end-skip "\n") (comment-style 'plain)) (comment-region (point-min) (point-max) -1)) nil nil 127)
  funcall-interactively(eval-expression (let ((comment-start "> ") (comment-start-skip "^> ?") (comment-end "") (comment-end-skip "\n") (comment-style 'plain)) (comment-region (point-min) (point-max) -1)) nil nil 127)
  #<subr call-interactively>(eval-expression nil nil)
  apply(#<subr call-interactively> eval-expression (nil nil))
  call-interactively@ido-cr+-record-current-command(#<subr call-interactively> eval-expression nil nil)
  apply(call-interactively@ido-cr+-record-current-command #<subr call-interactively> (eval-expression nil nil))
  call-interactively(eval-expression nil nil)
  command-execute(eval-expression)