Skip to content

Commit

Permalink
test: add example of IndexError during expansion of a parametrized macro
Browse files Browse the repository at this point in the history
Signed-off-by: Efimov Vasily <[email protected]>
  • Loading branch information
laerreal committed Oct 30, 2017
1 parent 12f4bd5 commit e71a4a0
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/testcpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,19 @@ def test_deadloop_macro(self):
a;"""
)

def test_index_error(self):
# If there are no tokens after a word ("a") which equals to name of
# a parameterized macro, then attempt to expand this word leads to
# IndexError.

self.__test_preprocessing("""\
#define a(x) x
a"""
, """\
a"""
)

main()

0 comments on commit e71a4a0

Please sign in to comment.