From 3ddcc8c7059135b7027467e2be119c927e684aff Mon Sep 17 00:00:00 2001 From: John McClean Date: Thu, 29 Oct 2015 22:09:19 +0000 Subject: [PATCH] bug fix for scanLeft / slice --- .../aol/simple/react/stream/traits/LazyFutureStream.java | 6 +++--- src/test/java/com/aol/simple/react/base/BaseSeqTest.java | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/aol/simple/react/stream/traits/LazyFutureStream.java b/src/main/java/com/aol/simple/react/stream/traits/LazyFutureStream.java index 8357d4e3b0..8e9a22947d 100644 --- a/src/main/java/com/aol/simple/react/stream/traits/LazyFutureStream.java +++ b/src/main/java/com/aol/simple/react/stream/traits/LazyFutureStream.java @@ -1565,7 +1565,7 @@ default Tuple2, LazyFutureStream> partitionFutureStream( @Override default LazyFutureStream slice(long from, long to) { - return fromStream(fromStream(SequenceM.fromStream(toQueue().stream(getSubscription())) + return fromStream(SequenceM.fromStream(toQueue().stream(getSubscription()) .slice(from, to))); } @@ -1634,7 +1634,7 @@ default LazyFutureStream zip(Seq other, @Override default LazyFutureStream scanLeft(T seed, BiFunction function) { - return fromStream(fromStream(SequenceM.fromStream(toQueue().stream(getSubscription())).scanLeft(seed, function))); + return fromStream(SequenceM.fromStream(toQueue().stream(getSubscription())).scanLeft(seed, function)); } @@ -1649,7 +1649,7 @@ default LazyFutureStream scanLeft(T seed, @Override default LazyFutureStream scanRight(R seed, BiFunction function) { - return fromStream(fromStream(SequenceM.fromStream(toQueue().stream(getSubscription())).scanRight(seed, function))); + return fromStream(SequenceM.fromStream(toQueue().stream(getSubscription())).scanRight(seed, function)); } diff --git a/src/test/java/com/aol/simple/react/base/BaseSeqTest.java b/src/test/java/com/aol/simple/react/base/BaseSeqTest.java index 8be2c99414..70c947001e 100644 --- a/src/test/java/com/aol/simple/react/base/BaseSeqTest.java +++ b/src/test/java/com/aol/simple/react/base/BaseSeqTest.java @@ -380,6 +380,7 @@ public void limitWhileTest(){ @Test public void testScanLeftStringConcat() { + assertThat(of("a", "b", "c").scanLeft("", String::concat).toList().size(), is(4)); }