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

Simplify report tests by using T.TempDir #1186

Merged
merged 1 commit into from
May 30, 2023
Merged

Simplify report tests by using T.TempDir #1186

merged 1 commit into from
May 30, 2023

Conversation

alexandear
Copy link
Contributor

Description:

This PR simplifies tests by using T.TempDir and bytes.Equal.

T.TempDir creates a temporary directory and automatically removes it after each test.
testdata/tmp became unnecessary. So, this folder was removed as well.
bytes.Equal is used to avoid string conversion.

Checklist:

  • Does your PR pass tests?
  • Have you written new tests for your changes?
  • Have you lint your code locally prior to submission?

@alexandear alexandear changed the title Simplify tests by using T.TempDir Simplify report tests by using T.TempDir May 29, 2023
@zricethezav
Copy link
Collaborator

@alexandear nice! Didn't know T had a TempDir function. Thanks!

@zricethezav zricethezav merged commit 6dbb0c5 into gitleaks:master May 30, 2023
1 check passed
@alexandear alexandear deleted the simplify-tests branch May 30, 2023 13:55
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.

None yet

2 participants