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) {
567567 @ SuppressWarnings ("unchecked" )
568568 public final U assertValueSequence (Iterable <? extends T > sequence ) {
569569 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 ();
572572 boolean actualNext ;
573573 boolean expectedNext ;
574574 for (;;) {
575- actualNext = it .hasNext ();
576- expectedNext = vit .hasNext ();
575+ expectedNext = expectedIterator .hasNext ();
576+ actualNext = actualIterator .hasNext ();
577577
578578 if (!actualNext || !expectedNext ) {
579579 break ;
580580 }
581581
582- T v = it .next ();
583- T u = vit .next ();
582+ T u = expectedIterator .next ();
583+ T v = actualIterator .next ();
584584
585585 if (!ObjectHelper .equals (u , v )) {
586586 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() {
956956 try {
957957 ts .assertValueSequence (Collections .<Integer >emptyList ());
958958 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)" ));
961961 }
962962
963963 try {
964964 ts .assertValueSequence (Collections .singletonList (1 ));
965965 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)" ));
968968 }
969969
970970 ts .assertValueSequence (Arrays .asList (1 , 2 ));
971971
972972 try {
973973 ts .assertValueSequence (Arrays .asList (1 , 2 , 3 ));
974974 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)" ));
977977 }
978978 }
979979
You can’t perform that action at this time.
0 commit comments