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

[Proposal]Add test with 0 element but not empty #86

Closed
meian opened this issue Feb 4, 2022 · 0 comments · Fixed by #88
Closed

[Proposal]Add test with 0 element but not empty #86

meian opened this issue Feb 4, 2022 · 0 comments · Fixed by #88
Assignees
Labels
improvement Some improvement

Comments

@meian
Copy link
Owner

meian commented Feb 4, 2022

Proposal.

Add common test case for empty element but no emptyIterable.
The test checks for no panic.
Use test source like below.

itb := gcf.FromSlice([]int{1})
itb = gcf.Filter(itb, func(v int) bool { return false })

What benefit with the proposal?

Since each Iterator does not expect to pass 0 Iterators, it could panic trying to process 0 Iterators.
By passing this test prevent that panic.

Others

emptyじゃない時にパニック起こさない汎用のテストケース作ってソース以外の関数に適用する

Originally posted by @meian in #83 (comment)

@meian meian added the improvement Some improvement label Feb 4, 2022
@meian meian self-assigned this Feb 5, 2022
meian added a commit that referenced this issue Feb 5, 2022
meian added a commit that referenced this issue Feb 5, 2022
meian added a commit that referenced this issue Feb 5, 2022
meian added a commit that referenced this issue Feb 5, 2022
meian added a commit that referenced this issue Feb 5, 2022
meian added a commit that referenced this issue Feb 5, 2022
@meian meian closed this as completed in #88 Feb 5, 2022
meian added a commit that referenced this issue Feb 5, 2022
…empty

#86 Add test with 0 element but not empty
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Some improvement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant