Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor tests to use with-simulated-input #634

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

matsl
Copy link
Collaborator

@matsl matsl commented Dec 28, 2024

What

Use with-simulated-input in more tests.

Why

Covers issues with using user input for constructing the referent
info.

Note

Not all tests related to hywiki-get-referent has been refactored due
to rather big test setups and coverage in other tests.

@matsl matsl force-pushed the add-with-simulated-input branch from da52254 to 458acef Compare December 28, 2024 16:00
@matsl matsl requested a review from rswgnu December 28, 2024 16:04
(should (equal '(bookmark . "bkmark") (hywiki-add-bookmark "WikiWord")))))
(bookmark-set "bookmark")
(with-simulated-input "bookmark RET"
(should (equal '(bookmark . "bookmark") (hywiki-add-bookmark "WikiWord")))))
Copy link
Owner

Choose a reason for hiding this comment

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

Rewrite like other tests where you first call hywiki-add-bookmark and then the should checks against hywiki-get-referent.

(hywiki-add-info-index "WikiWord")
(should (equal '(info-index . "(info)index-name") (hywiki-get-referent "WikiWord"))))
(should (equal '(info-index . "(emacs)Top") (hywiki-get-referent "WikiWord"))))
Copy link
Owner

Choose a reason for hiding this comment

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

This should be an Info index entry not an Info node.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Need to have some assistance here. Changed to "(emacs)files" but I guess that is still a node? Tried to use the function (hywiki-find-referent "WikiRefNew" t) interactively but I can't make it work. So I likely need some education here or there are problems with the functionality.

I was also expecting to find the possibility to add a referent in the hyperbole menu but had to call the function directly as given above to get the chance to select what type of referent it should be.

@matsl matsl force-pushed the add-with-simulated-input branch from 853470d to e095629 Compare December 29, 2024 23:18
@matsl matsl requested a review from rswgnu December 29, 2024 23:20
@rswgnu
Copy link
Owner

rswgnu commented Dec 29, 2024 via email

@matsl
Copy link
Collaborator Author

matsl commented Dec 29, 2024

In an Info manual, go to the end of the manual toc and you’ll see the indexes there. Navigate to one and then choose any index entry name from there as your test case, e.g. "(hyperbole)hyperbole-directory".

"(emacs)files" is a valid index then. (But see my skepticism below)

Use {C-u C-h h h c} to be prompted for the referent type when using the Create command.

Thanks for this. Although the docstring said use a prefix arg I did not expect that to be used with the regular hyperbole menu. But I have only been using it since 1993 so I guess I have a few more years to go before I can master it! ;-)

Anyway. It does not work for me. I'll send you a video to show what happens. (But that has to wait until tomorrow!)

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