Author: Armin Rigo <[email protected]>
Branch: cmacros
Changeset: r2238:b8ce44d5c791
Date: 2015-07-30 18:32 +0200
http://bitbucket.org/cffi/cffi/changeset/b8ce44d5c791/

Log:    One more passing test

diff --git a/testing/cffi0/test_parsing.py b/testing/cffi0/test_parsing.py
--- a/testing/cffi0/test_parsing.py
+++ b/testing/cffi0/test_parsing.py
@@ -230,6 +230,37 @@
         ''
     ]
 
+def test_extract_ifdefs_4():
+    parser = Parser()
+
+    _, macros = parser._extract_ifdefs("""
+    #ifdef ABC
+    #ifdef BCD
+    int q;
+    #elif BAR
+    int x;
+    #else
+    int y;
+    #endif
+    int z;
+    #endif
+    """)
+
+    assert macros == [
+        '',
+        None,
+        None,
+        '(defined(ABC)) && (defined(BCD))',
+        None,
+        '(defined(ABC)) && (!(defined(BCD)) && (BAR))',
+        None,
+        '(defined(ABC)) && (!(defined(BCD)) && !((BAR)))',
+        None,
+        'defined(ABC)',
+        None,
+        ''
+    ]
+
 def test_extract_ifdefs_continuation():
     parser = Parser()
 
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to