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

Try methods should return false for missing values #33

Merged
11 commits merged into from
Jun 29, 2017
Merged

Try methods should return false for missing values #33

11 commits merged into from
Jun 29, 2017

Conversation

ghost
Copy link

@ghost ghost commented Jun 27, 2017

Title is self explanatory..

assert := assert.New(t)
p := NewStaticProvider(nil)
t.Run("int", func(t *testing.T) {
_, ok := p.Get("missing").TryAsInt()
Copy link
Contributor

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

assert.False(ok)
})

t.Run("float", func(t *testing.T) {
Copy link
Contributor

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

@ghost ghost changed the base branch from alsam-collections to master June 28, 2017 20:54
@ghost ghost changed the base branch from master to alsam-collections June 28, 2017 20:54
@codecov
Copy link

codecov bot commented Jun 29, 2017

Codecov Report

Merging #33 into master will decrease coverage by 0.27%.
The diff coverage is 100%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
value.go 93.33% <100%> (-1.95%) ⬇️

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 11986ff...619978c. Read the comment docs.

@ghost ghost changed the base branch from alsam-collections to master June 29, 2017 00:52
@ghost ghost merged commit dfb888c into master Jun 29, 2017
@ghost ghost deleted the alsam-MIA branch June 29, 2017 00:59
@ghost ghost mentioned this pull request Jun 29, 2017
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant