Esempio n. 1
0
def test_mul_strings():
    py.test.skip('exercise!')
    code = [
        tla.CONST_INT, 3,
        tla.MUL,
        tla.RETURN
        ] 
    res = interp(code, tla.W_StringObject('foo '))
    assert res.strvalue == 'foo foo foo '
Esempio n. 2
0
def test_add_strings():
    py.test.skip('exercise!')
    code = [
        tla.NEWSTR,
        ord('d'), tla.ADD, tla.NEWSTR,
        ord('!'), tla.ADD, tla.RETURN
    ]
    res = interp(code, tla.W_StringObject('Hello worl'))
    assert res.strvalue == 'Hello world!'