aboutsummaryrefslogtreecommitdiffstats
path: root/bindings/python/llvm/tests
diff options
context:
space:
mode:
Diffstat (limited to 'bindings/python/llvm/tests')
-rw-r--r--bindings/python/llvm/tests/base.py3
-rw-r--r--bindings/python/llvm/tests/test_core.py4
-rw-r--r--bindings/python/llvm/tests/test_file1
3 files changed, 8 insertions, 0 deletions
diff --git a/bindings/python/llvm/tests/base.py b/bindings/python/llvm/tests/base.py
index ff9eb2f..22da5fd 100644
--- a/bindings/python/llvm/tests/base.py
+++ b/bindings/python/llvm/tests/base.py
@@ -30,3 +30,6 @@ class TestBase(unittest.TestCase):
raise Exception('No suitable test binaries available!')
get_test_binary.__test__ = False
+
+ def get_test_file(self):
+ return os.path.join(os.path.dirname(os.path.abspath(__file__)), "test_file")
diff --git a/bindings/python/llvm/tests/test_core.py b/bindings/python/llvm/tests/test_core.py
index 545abc8..699f310 100644
--- a/bindings/python/llvm/tests/test_core.py
+++ b/bindings/python/llvm/tests/test_core.py
@@ -21,3 +21,7 @@ class TestCore(TestBase):
with self.assertRaises(Exception):
MemoryBuffer(filename="/hopefully/this/path/doesnt/exist")
+ def test_memory_buffer_len(self):
+ source = self.get_test_file()
+ m = MemoryBuffer(filename=source)
+ self.assertEqual(len(m), 50)
diff --git a/bindings/python/llvm/tests/test_file b/bindings/python/llvm/tests/test_file
new file mode 100644
index 0000000..6c9b038
--- /dev/null
+++ b/bindings/python/llvm/tests/test_file
@@ -0,0 +1 @@
+I,"cAGxqԐdvl\L>g>``wɩ \ No newline at end of file