Commit fbc20b57 authored by Stefan Behnel's avatar Stefan Behnel

test for 'first assignment' algorithm

parent b7c56ce3
cimport cython
@cython.test_assert_path_exists(
"//SingleAssignmentNode",
"//SingleAssignmentNode[./NameNode[@name = 'a']]",
"//SingleAssignmentNode[./NameNode[@name = 'a'] and @first = True]",
)
def test_cdef():
cdef int a = 1
@cython.test_assert_path_exists(
"//SingleAssignmentNode",
"//SingleAssignmentNode[./NameNode[@name = 'a']]",
# FIXME: currently not working
# "//SingleAssignmentNode[./NameNode[@name = 'a'] and @first = True]",
)
def test_py():
a = 1
@cython.test_assert_path_exists(
"//SingleAssignmentNode",
"//SingleAssignmentNode[./NameNode[@name = 'a']]",
# FIXME: currently not working
# "//SingleAssignmentNode[./NameNode[@name = 'a'] and @first = True]",
)
def test_cond():
if True:
a = 1
else:
a = 2
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment