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

feat(assert): added AssertDirEmpty and AssertDirNotEmpty. fixes #37 #52

Conversation

schambers
Copy link
Contributor

Adds AssertDirEmpty, AssertDirNotEmpty by checking for io.EOF to assert an empty directory or not. This is more efficient than retrieving a slice of the objects in the directory.

I think everything here works, please let me know if I missed anything obvious or this is missing something.

Thank you!

@codecov
Copy link

codecov bot commented Oct 17, 2021

Codecov Report

Merging #52 (acc85e7) into main (9951098) will increase coverage by 0.20%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #52      +/-   ##
==========================================
+ Coverage   87.90%   88.10%   +0.20%     
==========================================
  Files          10       10              
  Lines         587      597      +10     
==========================================
+ Hits          516      526      +10     
  Misses         37       37              
  Partials       34       34              
Impacted Files Coverage Δ
assert.go 98.35% <100.00%> (+0.07%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9951098...acc85e7. Read the comment docs.

@MarvinJWendt
Copy link
Owner

Hi @schambers, the PR looks good! Could please fix the linting error (you can see it in the changed files view), thanks!

@schambers
Copy link
Contributor Author

@MarvinJWendt should be all set now! Thanks!

Copy link
Owner

@MarvinJWendt MarvinJWendt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a couple of small changes that I'd like.
I will merge the PR as soon as they are fixed :)
Thanks for the submission!

assert.go Outdated Show resolved Hide resolved
assert.go Outdated Show resolved Hide resolved
assert.go Outdated Show resolved Hide resolved
@MarvinJWendt MarvinJWendt linked an issue Oct 19, 2021 that may be closed by this pull request
schambers and others added 3 commits October 19, 2021 18:17
Co-authored-by: Marvin Wendt <git@marvinjwendt.com>
Co-authored-by: Marvin Wendt <git@marvinjwendt.com>
@schambers
Copy link
Contributor Author

Should be all set to go now @MarvinJWendt!

Copy link
Owner

@MarvinJWendt MarvinJWendt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the great work!
Could you please resolve the merge conflict?

@schambers
Copy link
Contributor Author

@MarvinJWendt should be all set now. Conflicts resolved and fixed up the formatting. Thanks!

@MarvinJWendt MarvinJWendt merged commit 6b3cb3e into MarvinJWendt:main Oct 20, 2021
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.

Add AssertDirEmpty and AssertDirNotEmpty
2 participants