summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEfimov Vasily <real@ispras.ru>2017-10-30 18:09:58 +0300
committerEfimov Vasily <real@ispras.ru>2017-10-30 19:58:22 +0300
commite71a4a041b87b8173f7b39b75a56fc2406736a38 (patch)
treecc0c8b22ae83c66a1ca3191c17b12e1c50da91c5
parent12f4bd55dd789d95218367ec8a3978f6fff5e00e (diff)
downloadply-e71a4a041b87b8173f7b39b75a56fc2406736a38.tar.gz
test: add example of IndexError during expansion of a parametrized macro
Signed-off-by: Efimov Vasily <real@ispras.ru>
-rw-r--r--test/testcpp.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/testcpp.py b/test/testcpp.py
index dba536e..2e98edd 100644
--- a/test/testcpp.py
+++ b/test/testcpp.py
@@ -83,4 +83,19 @@ a;"""
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()