Skip to content

Update and refactor hyrolo-tests.el#901

Merged
matsl merged 2 commits intomasterfrom
pr_update_and_refactor_hyrolo-tests
Mar 16, 2026
Merged

Update and refactor hyrolo-tests.el#901
matsl merged 2 commits intomasterfrom
pr_update_and_refactor_hyrolo-tests

Conversation

@matsl
Copy link
Collaborator

@matsl matsl commented Mar 14, 2026

What

Update and refactor hyrolo-tests.el

  • test/hyrolo-tests.el: Prefix all tests with hyrolo-tests. Use
    execute-kbd-macro instead of calling hact.
    (hyrolo-tests--add-items-interactive):
    (hyrolo-tests--hyrolo-grep-interactive): Add new separate test for
    interactive call.
    (hyrolo-tests--sort-test, hyrolo-tests--fgrep-find-all-types-of-files):
    Modify test to do both interactive and non-interactive call.
    (hyrolo-tests--fgrep-find-all-types-of-files): Use hy-delete-files-and-buffers.
    (hyrolo-tests--get-file-list): Use hy-delete-file-and-buffer.
    (hyrolo-tests--hyrolo-reveal-mode): Remove non-interactive guard.
    (hyrolo-tests--sort): Remove name suffix tests.

Why

While doing updates for interactive tests a set of small improvements
where found. This PR applies the updates into one PR with one commit.

@rswgnu
Copy link
Owner

rswgnu commented Mar 14, 2026

@matsl , let's discuss and finalize tomorrow. I'd like to understand the trade-offs of switching from kbd-key to execute-kbd-macro.

@matsl
Copy link
Collaborator Author

matsl commented Mar 16, 2026

let's discuss and finalize tomorrow. I'd like to understand the trade-offs of switching from kbd-key to execute-kbd-macro.

We did not discuss this in our last Talk. My thinking is like this:

  • I started to use hact 'kbd-key by a coincident. At the time I did not know of any other way to do it and I had the examples with kbd-key from Hyperbole and used that.
  • I have now realized that execute-kbd-macro works equally well. It seems by this experiment that the two ways are replaceable. So no functional difference.

Things I feel are better with execute-kbd-macro:

  • It is a standard Emacs function.
  • It is used for the same purposes by other programmers, like in Emacs source unit tests.
  • It is cleaner since it does not involve or use the system under test (Hyperbole) for this.

matsl added 2 commits March 16, 2026 21:34
* test/hyrolo-tests.el: Prefix all tests with hyrolo-tests. Use
    execute-kbd-macro instead of calling hact.
    (hyrolo-tests--add-items-interactive):
    (hyrolo-tests--hyrolo-grep-interactive): Add new separate test for
    interactive call.
    (hyrolo-tests--sort-test, hyrolo-tests--fgrep-find-all-types-of-files):
    Modify test to do both interactive and non-interactive call.
    (hyrolo-tests--fgrep-find-all-types-of-files): Use hy-delete-files-and-buffers.
    (hyrolo-tests--get-file-list): Use hy-delete-file-and-buffer.
    (hyrolo-tests--hyrolo-reveal-mode): Remove non-interactive guard.
    (hyrolo-tests--sort): Remove name suffix tests.
@matsl matsl force-pushed the pr_update_and_refactor_hyrolo-tests branch from ae79768 to 5d4ccee Compare March 16, 2026 20:36
@matsl matsl merged commit 38b7605 into master Mar 16, 2026
4 checks passed
@matsl matsl deleted the pr_update_and_refactor_hyrolo-tests branch March 16, 2026 21:53
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