[pypy-svn] r53659 - pypy/branch/io-improvements/pypy/rpython/test
fijal at codespeak.net
fijal at codespeak.net
Thu Apr 10 17:45:42 CEST 2008
Author: fijal
Date: Thu Apr 10 17:45:40 2008
New Revision: 53659
Modified:
pypy/branch/io-improvements/pypy/rpython/test/test_annlowlevel.py
Log:
Few passing tests, just because they're in my wc
Modified: pypy/branch/io-improvements/pypy/rpython/test/test_annlowlevel.py
==============================================================================
--- pypy/branch/io-improvements/pypy/rpython/test/test_annlowlevel.py (original)
+++ pypy/branch/io-improvements/pypy/rpython/test/test_annlowlevel.py Thu Apr 10 17:45:40 2008
@@ -4,7 +4,7 @@
from pypy.rpython.test.tool import BaseRtypingTest, LLRtypeMixin, OORtypeMixin
from pypy.rpython.lltypesystem.rstr import mallocstr
-from pypy.rpython.annlowlevel import hlstr
+from pypy.rpython.annlowlevel import hlstr, llstr
class TestLLType(BaseRtypingTest, LLRtypeMixin):
def test_hlstr(self):
@@ -13,4 +13,19 @@
s.chars[1] = "b"
s.chars[2] = "c"
assert hlstr(s) == "abc"
+
+ def test_llstr(self):
+ s = llstr("abc")
+ assert len(s.chars) == 3
+ assert s.chars[0] == "a"
+ assert s.chars[1] == "b"
+ assert s.chars[2] == "c"
+
+ def test_llstr_compile(self):
+ def f(arg):
+ s = llstr(hlstr(arg))
+ return len(s.chars)
+
+ res = self.interpret(f, [self.string_to_ll("abc")])
+ assert res == 3
More information about the Pypy-commit
mailing list