require() instead of assert() in specific test cases #86
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
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.The text was updated successfully, but these errors were encountered: