Skip to content

Commit 8033ac4

Browse files
committed
Refactoring Structure
1 parent 0b5e022 commit 8033ac4

File tree

3 files changed

+44
-2
lines changed

3 files changed

+44
-2
lines changed

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@ __pycache__/
22
build/
33
dist/
44
java_stream.egg-info/
5-
main.py
6-
performance.py
5+
main.py

.vscode/launch.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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+
}

tests/boolean/test.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44

55
class 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)

0 commit comments

Comments
 (0)