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 unsafe paste detection #801

Closed
danirabbit opened this issue Nov 7, 2024 · 3 comments
Closed

Add tests for unsafe paste detection #801

danirabbit opened this issue Nov 7, 2024 · 3 comments
Labels
Good First Issue Small, self-contained issue. Good for newcomers, and/or should be an easy fix. Priority: Wishlist An enhancement or new feature. Not a bug

Comments

@danirabbit
Copy link
Member

Problem

As unsafe paste detection gets more complex in the types of commands it checks for, the chance for regressing here increases

Proposal

We should make sure to have tests so that it's clear what we're testing for and that we don't regress on detecting those things

Prior Art (Optional)

No response

@danirabbit danirabbit added Priority: Wishlist An enhancement or new feature. Not a bug Good First Issue Small, self-contained issue. Good for newcomers, and/or should be an easy fix. labels Nov 7, 2024
@teamcons
Copy link
Contributor

teamcons commented Nov 8, 2024

This would be my first thought (as vala newbie)
-Move the if/or tapdancing into actual full fledged check_if_multiple, check_if_admin functions who manage all the logic (take a string, spit a boolean)
-test how well those functions works again several test strings
-Id be also fine doing testing on those functions (like against our bash history to see what those functions, as standalone binaries, can flag, or on the daily usage)

@jeremypw
Copy link
Collaborator

jeremypw commented Nov 8, 2024

Yes, some refactoring along those lines is probably required now the checks are more extensive.

@danirabbit
Copy link
Member Author

Fixed in #818

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good First Issue Small, self-contained issue. Good for newcomers, and/or should be an easy fix. Priority: Wishlist An enhancement or new feature. Not a bug
Projects
None yet
Development

No branches or pull requests

3 participants