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
95372310
Commit
95372310
authored
Jan 21, 2012
by
Taddeus Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed non-equal length check issue in non--strict node comparison.
parent
efc3c91b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
src/node.py
src/node.py
+6
-0
tests/test_node.py
tests/test_node.py
+5
-0
No files found.
src/node.py
View file @
95372310
...
@@ -253,6 +253,12 @@ class ExpressionNode(Node, ExpressionBase):
...
@@ -253,6 +253,12 @@ class ExpressionNode(Node, ExpressionBase):
if
self
.
op
in
(
OP_ADD
,
OP_MUL
):
if
self
.
op
in
(
OP_ADD
,
OP_MUL
):
s0
=
self
.
get_scope
()
s0
=
self
.
get_scope
()
s1
=
set
(
other
.
get_scope
())
s1
=
set
(
other
.
get_scope
())
# Scopes sould be of equal size
if
len
(
s0
)
!=
len
(
s1
):
return
False
# Each node in one scope should have an image node in the other
matched
=
set
()
matched
=
set
()
for
n0
in
s0
:
for
n0
in
s0
:
...
...
tests/test_node.py
View file @
95372310
...
@@ -129,6 +129,11 @@ class TestNode(unittest.TestCase):
...
@@ -129,6 +129,11 @@ class TestNode(unittest.TestCase):
self
.
assertTrue
(
p2
.
equals
(
p3
))
self
.
assertTrue
(
p2
.
equals
(
p3
))
self
.
assertFalse
(
p2
.
equals
(
p4
))
self
.
assertFalse
(
p2
.
equals
(
p4
))
def
test_equals_nary_mary
(
self
):
m0
,
m1
=
tree
(
'ab,2ab'
)
self
.
assertFalse
(
m0
.
equals
(
m1
))
def
test_equals_div
(
self
):
def
test_equals_div
(
self
):
d0
,
d1
,
d2
=
tree
(
'a / b,a / b,b / a'
)
d0
,
d1
,
d2
=
tree
(
'a / b,a / b,b / a'
)
...
...
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