Closed viceroypenguin closed 1 year ago
Merging #901 (74faa1f) into master (c081197) will not change coverage. The diff coverage is
n/a
.
@@ Coverage Diff @@
## master #901 +/- ##
=======================================
Coverage 92.41% 92.41%
=======================================
Files 112 112
Lines 3439 3439
Branches 1021 1021
=======================================
Hits 3178 3178
Misses 199 199
Partials 62 62
:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more
A future PR will make additional improvements, similar to viceroypenguin/SuperLinq#143.
TestingSequence
to prove it tests behavior correctly.This has been superseded by PR #936.
This PR updates the assertions made in
TestingSequence
:.Dispose()
multiple times. The.Dispose()
method is expected to be idempotent, such that it is callable multiple times without throwing an exception. As such, we should not be afraid to take advantage of such behavior when it makes code easier..MoveNext()
after receiving afalse
response. The enumerator is simply expected to continue to returnfalse
for each following call. As such, we should not be afraid to take advantage of such behavior when it makes code easier (see #905 for examples).IEnumerator
s do not complain when calling.MoveNext()
after disposal, it does indicate an error in our code to expect that.MoveNext()
is a valid behavior after we have disposed the iterator. As such, we should fail directly.IEnumerator
s return a default or the last value when calling.Current
after.MoveNext()
returnsfalse
, the spec does not make any promises on the usefulness of.Current
in this situation. More importantly, we should be relying on.MoveNext()
return value and not attempting to reference.Current
in these cases. As such, we should fail directly.IEnumerator
s do not complain when calling.Current
after disposal, it does indicate an error in our code to expect that.Current
is a valid behavior after we have disposed the iterator. As such, we should fail directly.