Skip to content

Conversation

@matsl
Copy link
Collaborator

@matsl matsl commented Jan 16, 2026

What

Working copy of trying to fix test framework to work with the new
version of HyWikiWord-highlighting.

Why

Sharing for collaboration on making the tests work again.

Notes

Some of the changes are general improvements I found while working on this. Things not really related to how the highlighting is done. That includes:

  • Cleaning up test cases better from some buffers that is not removed as they should. Mostly .eld-buffers that are not removed.
  • Making sure all tests that need hywiki-mode to starts with hywiki-mode off. So to avoid any dependency between test cases and the mode user is having before running the tests.
  • Adding preserve hywiki mode to more test cases for the same reason.
  • Other minor issues.

I'm not taking the time now but it could possibly be beneficial to apply these changes to the master branch as a separate task. Using that approach it makes it easier to separate out what is affecting what. i.e. if master branch works after these changes then we know for sure those does not effect the tests.

The more test related changes include:

  • Using find-file to get the buffer to get the hooks applied.
  • Calling the hooks from "test-command" and "test-self-insert" functions to simulate what happens when user types where each character is treated as a command whereas in an ert test the test is the command.
  • When having problems with getting the above with the hooks to work then apply the "hywiki hook functions" directly. (the run-hooks code is kept as a comment.)

The final word on what is really, really, really required here is not known. I had some success with the using find-file, some with adding the self-insert-hook and also with going straight to the hywiki-functions. It need further investigation.

Running the test suite with different versions of Emacs also gives different results. Ranging from 2 failed test to 8 failed. So there is some Emacs version dependencies.

;;
;; Orig-Date: 7-Dec-25 at 22:48:29
;; Last-Mod: 2-Jan-26 at 21:31:06 by Bob Weiner
;; Last-Mod: 14-Jan-26 at 16:48:20 by Mats Lidell
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ignore these changes to hsys-activities. I have a test case for activities that failed due to wrong messages. I did not realize I had not merged the tests yet to master so I thought rsw was branched out before that. I forgot to remove these changes before creating the PR.

(hywiki-add-org-id wiki-word-non-page)))
(hy-delete-file-and-buffer filea))))))
(hywiki-tests--preserve-hywiki-mode
(hywiki-mode nil)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason this test only work when hywiki-mode is off. This needs to be further investigated.

@matsl matsl requested a review from rswgnu January 16, 2026 16:23
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.

1 participant