2.x: fix assertValueSequence reversed error message#5594
2.x: fix assertValueSequence reversed error message#5594akarnokd merged 3 commits intoReactiveX:2.xfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## 2.x #5594 +/- ##
============================================
- Coverage 96.23% 96.22% -0.02%
- Complexity 5826 5827 +1
============================================
Files 632 632
Lines 41467 41467
Branches 5745 5745
============================================
- Hits 39906 39900 -6
- Misses 613 620 +7
+ Partials 948 947 -1
Continue to review full report at Codecov.
|
| @@ -958,13 +958,15 @@ public void assertValueSequence() { | |||
| throw new RuntimeException("Should have thrown"); | |||
| } catch (AssertionError ex) { | |||
| // expected | |||
There was a problem hiding this comment.
let's remove this then?
There was a problem hiding this comment.
I say let's keep it to indicate catching te AssertionError is not an accident.
There was a problem hiding this comment.
Usually that's done by naming exception as expected:
try {
// …
fail();
} catch (AssertionError expected) {
// Assert exception message, etc.
}
artem-zinnatullin
left a comment
There was a problem hiding this comment.
LGTM, but one more test pls
| @@ -958,13 +958,15 @@ public void assertValueSequence() { | |||
| throw new RuntimeException("Should have thrown"); | |||
| } catch (AssertionError ex) { | |||
| // expected | |||
There was a problem hiding this comment.
Usually that's done by naming exception as expected:
try {
// …
fail();
} catch (AssertionError expected) {
// Assert exception message, etc.
}|
|
||
| if (!ObjectHelper.equals(u, v)) { | ||
| throw fail("Values at position " + i + " differ; Expected: " + valueAndClass(u) + ", Actual: " + valueAndClass(v)); | ||
| throw fail("Values at position " + i + " differ; Expected: " + valueAndClass(v) + ", Actual: " + valueAndClass(u)); |
There was a problem hiding this comment.
This change also needs a test
There was a problem hiding this comment.
There is no behavior change here, just a swapped variable name. I'll restore the original u - expected, v - actual naming
There was a problem hiding this comment.
Ah. Well at least we have a valid reason to start working on RxJava 3 — kill these one-letter variable names ![]()
The error message/variable names in
TestBaseConsumer.assertValueSequencewas reversed: if more items were expected, it said "Fewer" and vice versa.