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 '
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!'