-
Notifications
You must be signed in to change notification settings - Fork 41
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
Try methods should return false for missing values #33
Conversation
static_provider_test.go
Outdated
assert := assert.New(t) | ||
p := NewStaticProvider(nil) | ||
t.Run("int", func(t *testing.T) { | ||
_, ok := p.Get("missing").TryAsInt() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
v := p.Get("missing")
can happen outside of these tests
static_provider_test.go
Outdated
assert.False(ok) | ||
}) | ||
|
||
t.Run("float", func(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
table-driven as opposed to sub-test would be much easier to write and maintain I think, but it's up to you
Codecov Report
@@ Coverage Diff @@
## master #33 +/- ##
=========================================
- Coverage 95.38% 95.1% -0.28%
=========================================
Files 12 12
Lines 736 735 -1
=========================================
- Hits 702 699 -3
- Misses 21 22 +1
- Partials 13 14 +1
Continue to review full report at Codecov.
|
Title is self explanatory..