Skip to content

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

Open
@ahpaleus

Description

@ahpaleus

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions