Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
trs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Taddeüs Kroes
trs
Commits
7175d986
Commit
7175d986
authored
13 years ago
by
Sander Mathijs van Veen
Browse files
Options
Downloads
Patches
Plain Diff
Added test cases for raise_numerics.
parent
c03390ba
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_rules_numerics.py
+11
-1
11 additions, 1 deletion
tests/test_rules_numerics.py
with
11 additions
and
1 deletion
tests/test_rules_numerics.py
+
11
−
1
View file @
7175d986
from
src.rules.numerics
import
match_add_numerics
,
add_numerics
,
\
match_divide_numerics
,
divide_numerics
,
match_multiply_numerics
,
\
multiply_numerics
multiply_numerics
,
raise_numerics
from
src.node
import
ExpressionLeaf
as
L
,
Scope
from
src.possibilities
import
Possibility
as
P
from
tests.rulestestcase
import
RulesTestCase
,
tree
...
...
@@ -131,3 +131,13 @@ class TestRulesNumerics(RulesTestCase):
l5_neg
,
l6
=
mul
self
.
assertEqualNodes
(
multiply_numerics
(
mul
,
(
Scope
(
mul
),
l5_neg
,
l6
)),
-
l30
)
def
test_raise_numerics
(
self
):
l1
,
l2
=
root
=
tree
(
'
2 ^ 3
'
)
self
.
assertEqualNodes
(
raise_numerics
(
root
,
(
l1
,
l2
)),
L
(
8
))
l1_neg
,
l2
=
root
=
tree
(
'
(-2) ^ 2
'
)
self
.
assertEqualNodes
(
raise_numerics
(
root
,
(
l1_neg
,
l2
)),
--
L
(
4
))
l1_neg
,
l2
=
root
=
tree
(
'
(-2) ^ 3
'
)
self
.
assertEqualNodes
(
raise_numerics
(
root
,
(
l1_neg
,
l2
)),
---
L
(
8
))
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment