File tree Expand file tree Collapse file tree 2 files changed +12
-12
lines changed
main/java/io/reactivex/observers
test/java/io/reactivex/observers Expand file tree Collapse file tree 2 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -567,20 +567,20 @@ public final U assertValueSet(Collection<? extends T> expected) {
567
567
@ SuppressWarnings ("unchecked" )
568
568
public final U assertValueSequence (Iterable <? extends T > sequence ) {
569
569
int i = 0 ;
570
- Iterator <T > vit = values .iterator ();
571
- Iterator <? extends T > it = sequence .iterator ();
570
+ Iterator <T > actualIterator = values .iterator ();
571
+ Iterator <? extends T > expectedIterator = sequence .iterator ();
572
572
boolean actualNext ;
573
573
boolean expectedNext ;
574
574
for (;;) {
575
- actualNext = it .hasNext ();
576
- expectedNext = vit .hasNext ();
575
+ expectedNext = expectedIterator .hasNext ();
576
+ actualNext = actualIterator .hasNext ();
577
577
578
578
if (!actualNext || !expectedNext ) {
579
579
break ;
580
580
}
581
581
582
- T v = it .next ();
583
- T u = vit .next ();
582
+ T u = expectedIterator .next ();
583
+ T v = actualIterator .next ();
584
584
585
585
if (!ObjectHelper .equals (u , v )) {
586
586
throw fail ("Values at position " + i + " differ; Expected: " + valueAndClass (u ) + ", Actual: " + valueAndClass (v ));
Original file line number Diff line number Diff line change @@ -956,24 +956,24 @@ public void assertValueSequence() {
956
956
try {
957
957
ts .assertValueSequence (Collections .<Integer >emptyList ());
958
958
throw new RuntimeException ("Should have thrown" );
959
- } catch (AssertionError ex ) {
960
- // expected
959
+ } catch (AssertionError expected ) {
960
+ assertTrue ( expected . getMessage (), expected . getMessage (). startsWith ( "More values received than expected (0)" ));
961
961
}
962
962
963
963
try {
964
964
ts .assertValueSequence (Collections .singletonList (1 ));
965
965
throw new RuntimeException ("Should have thrown" );
966
- } catch (AssertionError ex ) {
967
- // expected
966
+ } catch (AssertionError expected ) {
967
+ assertTrue ( expected . getMessage (), expected . getMessage (). startsWith ( "More values received than expected (1)" ));
968
968
}
969
969
970
970
ts .assertValueSequence (Arrays .asList (1 , 2 ));
971
971
972
972
try {
973
973
ts .assertValueSequence (Arrays .asList (1 , 2 , 3 ));
974
974
throw new RuntimeException ("Should have thrown" );
975
- } catch (AssertionError ex ) {
976
- // expected
975
+ } catch (AssertionError expected ) {
976
+ assertTrue ( expected . getMessage (), expected . getMessage (). startsWith ( "Fewer values received than expected (2)" ));
977
977
}
978
978
}
979
979
You can’t perform that action at this time.
0 commit comments