From 9038d8d17a1fe99906a60767acd08d2b02c42e28 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 9 Mar 2023 02:29:07 -0600 Subject: [PATCH] Add tip about substitute-quotes See . (Somehow org-export is broken due to a bug in prism, so the HTML still needs updating.) --- README.org | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/README.org b/README.org index e7cfb65..7f30233 100644 --- a/README.org +++ b/README.org @@ -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: @@ -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 @@ -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: -