File tree Expand file tree Collapse file tree 3 files changed +44
-2
lines changed
Expand file tree Collapse file tree 3 files changed +44
-2
lines changed Original file line number Diff line number Diff line change @@ -2,5 +2,4 @@ __pycache__/
22build /
33dist /
44java_stream.egg-info /
5- main.py
6- performance.py
5+ main.py
Original file line number Diff line number Diff line change 1+ {
2+ // Use IntelliSense to learn about possible attributes.
3+ // Hover to view descriptions of existing attributes.
4+ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+ "version" : " 0.2.0" ,
6+ "configurations" : [
7+ {
8+ "name" : " Python: Current File" ,
9+ "type" : " python" ,
10+ "request" : " launch" ,
11+ "program" : " ${file}" ,
12+ "console" : " integratedTerminal"
13+ },
14+ {
15+ "name" : " Tests: Stream" ,
16+ "type" : " python" ,
17+ "request" : " launch" ,
18+ "module" : " tests.stream"
19+ },
20+ {
21+ "name" : " Tests: Boolean" ,
22+ "type" : " python" ,
23+ "request" : " launch" ,
24+ "module" : " tests.boolean"
25+ },
26+ {
27+ "name" : " All Tests" ,
28+ "type" : " python" ,
29+ "request" : " launch" ,
30+ "module" : " tests"
31+ }
32+ ]
33+ }
Original file line number Diff line number Diff line change 44
55class TestBooleanStream (unittest .TestCase ):
66
7+ def test_random (self ):
8+ s = BooleanStream .random ().limit (20 )
9+ for elem in s :
10+ self .assertIn (elem , [True , False ])
11+
712 def test_true (self ):
813 s = BooleanStream .true ().limit (10 )
914 for elem in s :
@@ -13,3 +18,8 @@ def test_false(self):
1318 s = BooleanStream .false ().limit (10 )
1419 for elem in s :
1520 self .assertFalse (elem )
21+
22+ def test_filter (self ):
23+ s = BooleanStream .random ().limit (20 ).filter (lambda x : x )
24+ for elem in s :
25+ self .assertTrue (elem )
You can’t perform that action at this time.
0 commit comments