Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
tserg committed Sep 5, 2023
1 parent 036b20b commit f9daf1c
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 f9daf1c

Please sign in to comment.