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

require() instead of assert() in specific test cases #86

Open
ahpaleus opened this issue Jan 11, 2023 · 0 comments · May be fixed by #90
Open

require() instead of assert() in specific test cases #86

ahpaleus opened this issue Jan 11, 2023 · 0 comments · May be fixed by #90
Assignees
Labels
code-quality good first issue Good for newcomers help wanted Extra attention is needed on hold This issue was marked as not desirable to complete for now very-low-priority

Comments

@ahpaleus
Copy link
Contributor

ahpaleus commented Jan 11, 2023

Found when I was tinkering with custom tests. We can use require()-alike functions for specific tests, e.g., related to the fs operations, where a test case should not proceed.

For example, here:
https://github.com/trailofbits/medusa/blob/69fa1587de6e42e382a835f40316c4ec8382e8f4/utils/testutils/test_directory_utils.go#L21-L22

When a file (sourcePathInfo) does not exist, a test case continues and panics here:
https://github.com/trailofbits/medusa/blob/69fa1587de6e42e382a835f40316c4ec8382e8f4/utils/testutils/test_directory_utils.go#L26-L26

just replace it with the require.NotNil(t, sourcePathInfo), and so on.

@ahpaleus ahpaleus self-assigned this Jan 20, 2023
@anishnaik anishnaik added the help wanted Extra attention is needed label Aug 18, 2023
@anishnaik anishnaik added code-quality on hold This issue was marked as not desirable to complete for now very-low-priority labels Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code-quality good first issue Good for newcomers help wanted Extra attention is needed on hold This issue was marked as not desirable to complete for now very-low-priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants