[pypy-commit] cffi cmacros: One more passing test

arigo noreply at buildbot.pypy.org
Thu Jul 30 22:41:29 CEST 2015


Author: Armin Rigo <arigo at tunes.org>
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()
 


More information about the pypy-commit mailing list