Skip to content

Commit

Permalink
Add tip about substitute-quotes
Browse files Browse the repository at this point in the history
See <jorgenschaefer/emacs-buttercup#228>.

(Somehow org-export is broken due to a bug in prism, so the HTML still
needs updating.)
  • Loading branch information
alphapapa committed Mar 9, 2023
1 parent c4c9034 commit 9038d8d
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion README.org
Original file line number Diff line number Diff line change
Expand Up @@ -3171,6 +3171,8 @@ Since this happens at macro expansion time rather than at runtime, there is no p
- [[#propcheck-quickcheckhypothesis-style-testing][propcheck: Quickcheck/hypothesis style testing]]
- [[#with-simulated-input-test-interactive-functions-non-interactively][with-simulated-input: Test interactive functions non-interactively]]
- [[#xtest-extensions-for-ert][xtest: Extensions for ERT]]
- [[#tips][Tips]]
- [[#error-message-strings-may-not-match-after-substitute-quotes][Error message strings may not match after substitute-quotes]]
- [[#tools][Tools]]
:END:

Expand Down Expand Up @@ -3281,6 +3283,14 @@ Some interactive functions rely on idle timers to do their work, so you might ne
XTest is a simple set of extensions for ERT. XTest speeds up the creation of tests that follow the “one assertion per test” rule of thumb. It also simplifies testing functions that manipulate buffers. XTest aims to do a few things well, instead of being a monolithic library that attempts to solve every conceivable testing need. XTest is designed to be paired with vanilla ERT and other ERT libraries, where the user mixes and matches depending on their needs.
#+END_QUOTE

*** Tips :tips:

**** Error message strings may not match after ~substitute-quotes~

When testing error messages, the message string in the test suite might not match the value captured by the test output, because Emacs may run ~substitute-quotes~ on the message. This may result in various quotation marks being changed. It can even be the case that the difference only manifests on other systems (e.g. the tests may pass on the developer's system but fail on a remote CI system due to different locale settings).

To work around this, pass a format string to ~error~, like ~(error "%s" "Foo doesn't bar")~, which prevents Emacs from changing the quotes. (For more information, see [[https://github.com/jorgenschaefer/emacs-buttercup/issues/228][this issue]].)

*** Tools :tools:
:PROPERTIES:
:TOC: :depth 0
Expand Down Expand Up @@ -4534,4 +4544,3 @@ I love Emacs and Org mode. This makes it so easy to make the document...alive!
# org-id-link-to-org-use-id: nil
# org-export-initial-scope: buffer
# End:

0 comments on commit 9038d8d

Please sign in to comment.