Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix eask-test-ert--message breaks tests which trigger minibuffer #286

Merged
merged 2 commits into from
Dec 3, 2024

Conversation

joshbax189
Copy link
Contributor

From the doco: (message nil) can be used to clear the minibuffer.

However, eask-test-ert--message is advised on message when running eask test ert and passes all message args to format, which requires a format string.

The provided test incorrectly fails with a signal (it should succeed)

(ert-deftest ert-test-1 ()
  (should-not (message nil)))

The backtrace is like

Test ert-test-1 backtrace:
  format(nil)
  apply(format nil)
  (string-match-p "^[ ]+FAILED " (apply #'format args))
  (cond ((string-match-p "^[ ]+FAILED " (apply #'format args)) (eask-m
  (let ((eask-test-ert--message-loop t)) (cond ((string-match-p "^[ ]+
  (if eask-test-ert--message-loop (apply fnc args) (let ((eask-test-er
  eask-test-ert--message(#<subr message> nil)
  apply(eask-test-ert--message #<subr message> nil)
  message(nil)
  apply(message nil)
...

Fixed by passing the nil argument to message. This does not appear to create extra messages in Eask output.

@jcs090218
Copy link
Member

jcs090218 commented Dec 3, 2024

Some nits. Most look good to me! 🚀

@joshbax189 joshbax189 force-pushed the fix/ert-null-message branch from 9490969 to 5a3c28b Compare December 3, 2024 05:39
@jcs090218 jcs090218 merged commit a6ac555 into emacs-eask:master Dec 3, 2024
142 of 143 checks passed
@jcs090218
Copy link
Member

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants