Author: Jean-Sebastien Bevilacqua <[email protected]>
Branch: binary_enum
Changeset: r2912:330013c6d0c3
Date: 2017-03-15 21:10 +0100
http://bitbucket.org/cffi/cffi/changeset/330013c6d0c3/

Log:    Add test for binary operation in enum definition

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
@@ -386,13 +386,14 @@
 def test_enum():
     ffi = FFI()
     ffi.cdef("""
-        enum Enum { POS = +1, TWO = 2, NIL = 0, NEG = -1};
+        enum Enum { POS = +1, TWO = 2, NIL = 0, NEG = -1, OP = (POS+TWO)-1};
         """)
     C = ffi.dlopen(None)
     assert C.POS == 1
     assert C.TWO == 2
     assert C.NIL == 0
     assert C.NEG == -1
+    assert C.OP == 2
 
 def test_stdcall():
     ffi = FFI()
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to