Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
trs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
trs
Commits
dfeff0fb
Commit
dfeff0fb
authored
Dec 13, 2011
by
Sander Mathijs van Veen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added missing unit tests for book 1 chapter 10.
parent
0d06e0ae
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
0 deletions
+55
-0
tests/test_b1_ch10.py
tests/test_b1_ch10.py
+55
-0
No files found.
tests/test_b1_ch10.py
0 → 100644
View file @
dfeff0fb
import
unittest
from
src.parser
import
Parser
from
src.node
import
ExpressionNode
as
N
,
ExpressionLeaf
as
L
from
tests.parser
import
run_expressions
class
TestB1Ch10
(
unittest
.
TestCase
):
def
test_diagnostic_test
(
self
):
run_expressions
(
Parser
,
[
(
'5(a-2b)'
,
N
(
'*'
,
L
(
5
),
N
(
'-'
,
L
(
'a'
),
N
(
'*'
,
L
(
2
),
L
(
'b'
))))),
(
'-(3a+6b)'
,
N
(
'-'
,
N
(
'+'
,
N
(
'*'
,
L
(
3
),
L
(
'a'
)),
N
(
'*'
,
L
(
6
),
L
(
'b'
))))),
(
'18-(a-12)'
,
N
(
'-'
,
L
(
18
),
N
(
'-'
,
L
(
'a'
),
L
(
12
)))),
(
'-p-q+5(p-q)-3q-2(p-q)'
,
N
(
'-'
,
N
(
'-'
,
N
(
'+'
,
N
(
'-'
,
N
(
'-'
,
L
(
'p'
)),
L
(
'q'
)),
N
(
'*'
,
L
(
5
),
N
(
'-'
,
L
(
'p'
),
L
(
'q'
)))),
N
(
'*'
,
L
(
3
),
L
(
'q'
))
),
N
(
'*'
,
L
(
2
),
N
(
'-'
,
L
(
'p'
),
L
(
'q'
)))
)
),
(
'(2+3/7)^4'
,
N
(
'^'
,
N
(
'+'
,
L
(
2
),
N
(
'/'
,
L
(
3
),
L
(
7
))),
L
(
4
))
),
(
'x3*x2*x'
,
N
(
'*'
,
N
(
'*'
,
N
(
'^'
,
L
(
'x'
),
L
(
3
)),
N
(
'^'
,
L
(
'x'
),
L
(
2
))),
L
(
'x'
)
)
),
(
'-x3*-2x5'
,
N
(
'*'
,
N
(
'*'
,
N
(
'-'
,
N
(
'^'
,
L
(
'x'
),
L
(
3
))),
N
(
'-'
,
L
(
2
))),
N
(
'^'
,
L
(
'x'
),
L
(
5
))
)
),
(
'(7x2y3)^2/(7x2y3)'
,
N
(
'*'
,
N
(
'*'
,
N
(
'-'
,
N
(
'^'
,
L
(
'x'
),
L
(
3
))),
N
(
'-'
,
L
(
2
))),
N
(
'^'
,
L
(
'x'
),
L
(
5
))
)
),
])
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment