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

Fix 'rejects invalid pressKey' test #35

Closed
wants to merge 1 commit into from

Conversation

mzgoddard
Copy link
Contributor

The test rejects invalid "pressKey" currently fails. The underlying behaviour does not return the expected message but a different one. Fix the message to what the current behaviour returns.

@mzgoddard mzgoddard requested a review from jugglinmike January 30, 2024 17:32
@jugglinmike
Copy link
Contributor

@mzgoddard on my machine, this test passes in main and fails with this patch applied. I see that you observed a test failure in gh-34, but because there aren't any CI logs which demonstrate it, I don't have any ideas about what could be causing the discrepancy.

The test on the main branch matches my intuitive understanding of the code, so I'll share that to help us get to the bottom of this. By my reading, the message "unknown key" is only used when the "key" includes a character in the range [\ue000-\ue05d]. The test specifies the key as the string "df daf% ?". While clearly invalid as a "key", the string doesn't include any character in that range (those spaces are U+0020), so it should be tolerated. The expected error occurs when this complete string is passed to the keyToggle method provided by RobotJS.

Does that make sense to you?

@mzgoddard mzgoddard mentioned this pull request Feb 1, 2024
@mzgoddard
Copy link
Contributor Author

Yeah. I see the mistake I made in trying to understand the error. I couldn't find the line in lib making the error message. And I overlooked it being an error produced by robotjs. Gonna close this and update one of the error messages in #37 to pass this test.

@mzgoddard mzgoddard closed this Feb 1, 2024
@mzgoddard mzgoddard deleted the fix-invalid-presskey-test branch February 1, 2024 02:52
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