Add global string print test.
This commit is contained in:
parent
0de46e8ded
commit
a9a9fd7d0b
|
@ -39,3 +39,25 @@ def test():
|
||||||
c.functions.test().transact({"gas": 22000})
|
c.functions.test().transact({"gas": 22000})
|
||||||
|
|
||||||
assert get_last_out(stdout) == '-123'
|
assert get_last_out(stdout) == '-123'
|
||||||
|
|
||||||
|
|
||||||
|
def test_print_string_from_storage(get_contract, get_last_out):
|
||||||
|
code = """
|
||||||
|
car: public(string[64])
|
||||||
|
|
||||||
|
@public
|
||||||
|
def getCar() -> string[64]:
|
||||||
|
self.car = "My little car!"
|
||||||
|
vdb
|
||||||
|
return self.car
|
||||||
|
"""
|
||||||
|
|
||||||
|
stdin = io.StringIO(
|
||||||
|
"self.car\n"
|
||||||
|
)
|
||||||
|
stdout = io.StringIO()
|
||||||
|
|
||||||
|
c = get_contract(code, stdin=stdin, stdout=stdout)
|
||||||
|
c.functions.getCar().call({"gas": 92000})
|
||||||
|
|
||||||
|
assert get_last_out(stdout) == "My little car!"
|
||||||
|
|
Loading…
Reference in New Issue