-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3949 from lrytz/t8627
SI-8627 make Stream.filterNot non-eager
- Loading branch information
Showing
6 changed files
with
139 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package scala.collection.immutable | ||
|
||
import org.junit.runner.RunWith | ||
import org.junit.runners.JUnit4 | ||
import org.junit.Test | ||
import org.junit.Assert._ | ||
|
||
@RunWith(classOf[JUnit4]) | ||
class StreamTest { | ||
|
||
@Test | ||
def t6727_and_t6440(): Unit = { | ||
assertTrue(Stream.continually(()).filter(_ => true).take(2) == Seq((), ())) | ||
assertTrue(Stream.continually(()).filterNot(_ => false).take(2) == Seq((), ())) | ||
assertTrue(Stream(1,2,3,4,5).filter(_ < 4) == Seq(1,2,3)) | ||
assertTrue(Stream(1,2,3,4,5).filterNot(_ > 4) == Seq(1,2,3,4)) | ||
} | ||
} |