* lisp/mh-e/mh-utils.el (mh-sub-folders-parse):
Support Mailutils style of "folders +/" output.
* test/lisp/mh-e/mh-utils.el:
Test "folders +/" with GNU Mailutils 3.13.91 and later.
* test/lisp/mh-e/mh-utils.el (mh-sub-folders-parse-no-folder)
(mh-sub-folders-parse-relative-folder, mh-sub-folders-parse-root-folder):
New tests.
* lisp/mh-e/mh-utils.el (mh-sub-folders-parse): New function,
refactored out of 'mh-sub-folders-actual' to create a testing seam.
* test/lisp/mh-e/mh-utils-tests.el
(mh-sub-folders-actual, mh-sub-folders): Add new tests of "folders +/".
Rewrite tests that were using 'assoc' to use 'member' instead, so that
on failure, ERT logs the list of which the element was not a member,
rather than the 'nil' returned by 'assoc'.
(mh-test-variant-handles-plus-slash): Factor out new helper function.
(mh-folder-completion-function-08-plus-slash)
(mh-folder-completion-function-09-plus-slash-tmp):
Use new helper function.
* test/lisp/mh-e/test-all-mh-variants.sh: LD_LIBRARY_PATH unnecessary.
* test/lisp/mh-e/mh-utils-tests.el
(mh-folder-completion-function-08-plus-slash)
(mh-folder-completion-function-09-plus-slash-tmp): Temporarily
mark two failing tests as unstable.
* lisp/mh-e/mh-utils.el (mh-sub-folders): Fix handling of "+/".
* test/lisp/mh-e/mh-utils-tests.el
(mh-folder-completion-function-08-plus-slash)
(mh-folder-completion-function-09-plus-slash-tmp):
Fix errors made importing tests from mh-unit.el; remove declaration
that these tests are expected to fail.
* lisp/mh-e/mh-thread.el (mh-thread-current-indentation-level)
(mh-thread-find-children): Fix off-by-one error by using
'mh-scan-field-from-start-offset' directly, as
'mh-thread-parse-scan-line' does. Previously, these functions would
incorrectly consider the "date note" column as part of the thread
indenting. Since that column is almost always a Space character, that
almost always worked.
(mh-thread-ancestor): Update caller.
* test/lisp/mh-e/mh-thread-tests.el: New unit tests for affected code.
* lisp/mh-e/mh-scan.el (mh-msg-num-width-to-column): Fix doc string typo.
* test/lisp/mh-e/mh-utils-tests.el: Environment variable TEST_MH_PATH
controls which installed MH variant to test with. Moved the commentary
about testing with different MH variants from above 'with-mh-test-env'
definition to "Commentary" section at the top of the file.
* test/lisp/mh-e/test-all-mh-variants.sh: New script to test all
installed MH variants.
* test/lisp/mh-e/mh-utils-tests.el (with-mh-test-env): Refactor to
reduce the size of the expanded macro.
(mh-test-utils-setup): New helper function.
(mh-ensure-native-trampolines): Absorbed by mh-test-utils-setup.
* doc/lispref/compile.texi (Native Compilation): Document
native-comp-available-p as the way to test for native compilation.
* lisp/emacs-lisp/package.el (package--native-compile-async):
* test/lisp/mh-e/mh-utils-tests.el (mh-ensure-native-trampolines):
Test for native compilation with native-comp-available-p.
Thank you to Andrea Corallo for reviewing this patch.
* test/lisp/mh-e/mh-utils-tests.el (mh-ensure-native-trampolines):
New function.
(mh-test-utils-setup-with-mocks)
(mh-test-utils-setup-with-variant): Use it.
* test/lisp/mh-e/mh-limit-tests.el:
* test/lisp/mh-e/mh-utils-tests.el:
* test/lisp/mh-e/mh-xface-tests.el:
Import the functional tests from src/mh-unit.el.
mh-unit.el is from the old SourceForge mh-e repository, last changed
in 2017. To this are applied unmerged patches Mike Kupfer wrote in
2018 ("Refactor mh-unit into functional and release tests" and
"Fix the functional tests").
All tests have been converted to run under Emacs's ERT framework.
Some tests for mh-utils use MH programs to examine mail folders.
These tests require an MH variant to be installed on the system; for
these, added both a mock harness that pretends the needed files and MH
programs do exist, and a wrapper that creates the necessary mail files.
New function 'mh-test-utils-setup-with-variant' bears some resemblance
to 'mh-test-folders-set-up' from the original tests. New function
'mh-test-utils-setup-with-mocks' is new functionality for these tests.