cython.inline test
authorRobert Bradshaw <robertwb@math.washington.edu>
Sat, 11 Dec 2010 02:06:43 +0000 (18:06 -0800)
committerRobert Bradshaw <robertwb@math.washington.edu>
Sat, 11 Dec 2010 02:06:43 +0000 (18:06 -0800)
Cython/Build/Inline.py
Cython/Build/Tests/TestInline.py [new file with mode: 0644]

index 1ef7a21888c871db035ad3dc95618737496ea536..abbcfb42aecab3322628ee313cc7c8bb09df8031 100644 (file)
@@ -92,7 +92,7 @@ def cython_inline(code,
         get_type = lambda x: 'object'
     code, literals = strip_string_literals(code)
     code = strip_common_indent(code)
-    ctx = Context(include_dirs, default_options)
+    ctx = Context(cython_include_dirs, default_options)
     if locals is None:
         locals = inspect.currentframe().f_back.f_back.f_locals
     if globals is None:
diff --git a/Cython/Build/Tests/TestInline.py b/Cython/Build/Tests/TestInline.py
new file mode 100644 (file)
index 0000000..8a8fb78
--- /dev/null
@@ -0,0 +1,8 @@
+from Cython.Shadow import inline
+
+from Cython.TestUtils import CythonTest
+
+class TestStripLiterals(CythonTest):
+
+    def test_inline(self):
+        self.assertEquals(inline("return 1+2"), 3)