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

Add tests for ebut-link-directly and gbut-link-directly #410

Merged
merged 4 commits into from
Nov 30, 2023

Conversation

matsl
Copy link
Collaborator

@matsl matsl commented Nov 30, 2023

What

Add tests for ebut-link-directly and gbut-link-directly.

Note

Copied from similar ibut test cases.

(with-simulated-input "button RET"
(hui:ebut-link-directly (get-buffer-window) (get-buffer-window dir-buf))
;; Implicit link should be the `dir' dired directory,
;; possibly minus the final directory '/'.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is copied from the ibut test case. @rswgnu Why the possibly? Apparently a directory can be without a trailing slash in the ebut args, but why?

I transformed it in this test case to a file name so the test will pass but that feels a bit hacky. Should we not make sure all link-to-directory ebuts have a trailing slash?

Can this be related to that environment variables can be inserted in the ebut args and that it could make it hard to be consistent? Do we need to relax the requirement for a trailing slash here so that the helper function, hy-test-helpers-verify-hattr-at-p, should ignore the trailing slash difference?

Copy link
Owner

Choose a reason for hiding this comment

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

I think so. There are too many code paths where a dir without a final slash could come in.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

OK. Will update the general helper check so that when verifying a link-to-directory both versions, with and without slash i checked.

@matsl matsl requested a review from rswgnu November 30, 2023 18:00
@matsl matsl changed the title Add tests for ebut-link-directly Add tests for ebut-link-directly and gbut-link-directly Nov 30, 2023
@rswgnu rswgnu merged commit 3692855 into master Nov 30, 2023
5 checks passed
@matsl matsl deleted the add-tests-for-ebut-link-directly branch December 1, 2023 09:46
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