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

MF-1198 - Add errors package tests #1207

Merged
merged 6 commits into from
Jun 12, 2020

Conversation

darkodraskovic
Copy link
Contributor

Add unit tests to errors package from pkg/.

Resolves #1198

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>
Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>
Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>
@darkodraskovic darkodraskovic requested a review from a team as a code owner June 11, 2020 12:04
@blokovi
Copy link
Contributor

blokovi commented Jun 11, 2020

Did you consider to include test cases when error is nil (for any of these tests)?

pkg/errors/errors_test.go Outdated Show resolved Hide resolved
pkg/errors/errors_test.go Outdated Show resolved Hide resolved
pkg/errors/errors_test.go Show resolved Hide resolved
@darkodraskovic
Copy link
Contributor Author

Did you consider to include test cases when error is nil (for any of these tests)?
Actually, a very good idea :D and an omission from my side...

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>
@darkodraskovic darkodraskovic marked this pull request as draft June 11, 2020 12:58
@codecov-commenter
Copy link

codecov-commenter commented Jun 11, 2020

Codecov Report

Merging #1207 into master will decrease coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1207      +/-   ##
==========================================
- Coverage   77.06%   77.04%   -0.03%     
==========================================
  Files         103      104       +1     
  Lines        6893     6934      +41     
==========================================
+ Hits         5312     5342      +30     
- Misses       1197     1206       +9     
- Partials      384      386       +2     
Impacted Files Coverage Δ
pkg/errors/errors.go 73.17% <0.00%> (ø)

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 381a15a...a5a07d3. Read the comment docs.

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>
@darkodraskovic darkodraskovic marked this pull request as ready for review June 11, 2020 16:15
Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>
Copy link
Contributor

@manuio manuio left a comment

Choose a reason for hiding this comment

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

LGTM

@darkodraskovic darkodraskovic merged commit 4a9c740 into absmach:master Jun 12, 2020
@darkodraskovic darkodraskovic deleted the error_tests branch June 18, 2020 15:38
manuio pushed a commit that referenced this pull request Oct 12, 2020
* Add tests for errors package

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add recursive fn to gen wrapped errs and func to gen corresponding msg

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add TestWrap func

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Replace literal string msgs with res of messages()

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add nil tests for errors.Contains()

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add nil tests for Wrap()

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>
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 errors package tests
4 participants