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
8d921d80
Commit
8d921d80
authored
Feb 28, 2012
by
Taddeus Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a validation test.
parent
5211c176
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
1 deletion
+1
-1
src/rules/fractions.py
src/rules/fractions.py
+0
-1
tests/test_validation.py
tests/test_validation.py
+1
-0
No files found.
src/rules/fractions.py
View file @
8d921d80
...
@@ -235,7 +235,6 @@ def match_divide_fractions(node):
...
@@ -235,7 +235,6 @@ def match_divide_fractions(node):
a / b / c -> a / (bc)
a / b / c -> a / (bc)
a / (b / c) -> ac / b
a / (b / c) -> ac / b
"""
"""
# TODO: IMPLICIT: a / b / (c / d) ->* ad / bd -> validation test!
assert
node
.
is_op
(
OP_DIV
)
assert
node
.
is_op
(
OP_DIV
)
nom
,
denom
=
node
nom
,
denom
=
node
...
...
tests/test_validation.py
View file @
8d921d80
...
@@ -12,6 +12,7 @@ class TestValidation(TestCase):
...
@@ -12,6 +12,7 @@ class TestValidation(TestCase):
def
test_intermediate_success
(
self
):
def
test_intermediate_success
(
self
):
self
.
assertTrue
(
validate
(
'3a+a+b+2b'
,
'4a+3b'
))
self
.
assertTrue
(
validate
(
'3a+a+b+2b'
,
'4a+3b'
))
self
.
assertTrue
(
validate
(
'a/b/(c/d)'
,
'ad/(bc)'
))
def
test_intermediate_failure
(
self
):
def
test_intermediate_failure
(
self
):
self
.
assertFalse
(
validate
(
'3a+a+b+2b'
,
'4a+4b'
))
self
.
assertFalse
(
validate
(
'3a+a+b+2b'
,
'4a+4b'
))
...
...
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