diff options
author | Efimov Vasily <real@ispras.ru> | 2017-10-30 19:12:58 +0300 |
---|---|---|
committer | Efimov Vasily <real@ispras.ru> | 2017-10-30 19:35:50 +0300 |
commit | 9fdca0bf6ae95e0dc4d8e93f22256e7c90f28f6e (patch) | |
tree | 23f9655b47093dcd020e6144ee64785ec6a86b91 | |
parent | 1fd7e1222c6c93678b9dee56cac972b51b5abc97 (diff) | |
download | ply-9fdca0bf6ae95e0dc4d8e93f22256e7c90f28f6e.tar.gz |
test: add example of incorrect expansion of concatenation (##) in macro
Signed-off-by: Efimov Vasily <real@ispras.ru>
-rw-r--r-- | test/testcpp.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/testcpp.py b/test/testcpp.py index 2582c03..51508c4 100644 --- a/test/testcpp.py +++ b/test/testcpp.py @@ -45,4 +45,27 @@ class CPPTests(TestCase): else: self.assertMultiLineEqual(out, expected) + def test_concatenation(self): + self.__test_preprocessing("""\ +#define a(x) x##_ +#define b(x) _##x +#define c(x) _##x##_ +#define d(x,y) _##x##y##_ + +a(i) +b(j) +c(k) +d(q,s)""" + , """\ + + + + + +i_ +_j +_k_ +_qs_""" + ) + main() |