-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #183 from DanielSchiavini/coverage
chore: test coverage
- Loading branch information
Showing
24 changed files
with
408 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import boa | ||
|
||
|
||
def test_decode_struct(): | ||
code = """ | ||
struct Point: | ||
x: int8 | ||
y: int8 | ||
point: Point | ||
@external | ||
def __init__(): | ||
self.point = Point({x: 1, y: 2}) | ||
""" | ||
result = boa.loads(code)._storage.point.get() | ||
assert str(result) == "Point({'x': 1, 'y': 2})" | ||
|
||
|
||
def test_decode_tuple(): | ||
code = """ | ||
point: (int8, int8) | ||
@external | ||
def __init__(): | ||
self.point[0] = 1 | ||
self.point[1] = 2 | ||
""" | ||
assert boa.loads(code)._storage.point.get() == (1, 2) | ||
|
||
|
||
def test_decode_string_array(): | ||
code = """ | ||
point: int8[2] | ||
@external | ||
def __init__(): | ||
self.point[0] = 1 | ||
self.point[1] = 2 | ||
""" | ||
assert boa.loads(code)._storage.point.get() == [1, 2] | ||
|
||
|
||
def test_decode_bytes_m(): | ||
code = """ | ||
b: bytes2 | ||
@external | ||
def __init__(): | ||
self.b = 0xd9b6 | ||
""" | ||
assert boa.loads(code)._storage.b.get() == bytes.fromhex("d9b6") | ||
|
||
|
||
def test_decode_dynarray(): | ||
code = """ | ||
point: DynArray[int8, 10] | ||
@external | ||
def __init__(): | ||
self.point = [1, 2] | ||
""" | ||
assert boa.loads(code)._storage.point.get() == [1, 2] |
Oops, something went wrong.