diff options
author | Efimov Vasily <real@ispras.ru> | 2017-10-30 18:09:58 +0300 |
---|---|---|
committer | Efimov Vasily <real@ispras.ru> | 2017-10-30 19:58:22 +0300 |
commit | e71a4a041b87b8173f7b39b75a56fc2406736a38 (patch) | |
tree | cc0c8b22ae83c66a1ca3191c17b12e1c50da91c5 | |
parent | 12f4bd55dd789d95218367ec8a3978f6fff5e00e (diff) | |
download | ply-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.py | 15 |
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() |