Skip to content

Commit

Permalink
Merge pull request #16 from tserg/fix/metadata-update
Browse files Browse the repository at this point in the history
add test
  • Loading branch information
charles-cooper authored Sep 5, 2023
2 parents 036b20b + f9daf1c commit f1ebd54
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/ast/test_metadata_journal.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from vyper.ast.metadata import NodeMetadata
from vyper.exceptions import VyperException


def test_metadata_journal():
m = NodeMetadata()

m["x"] = 1
try:
with m.enter_typechecker_speculation():
m["x"] = 2
m["x"] = 3

assert m["x"] == 3
raise VyperException("dummy exception")

except VyperException:
pass

# rollback upon exception
assert m["x"] == 1

0 comments on commit f1ebd54

Please sign in to comment.