This is a set of tiny utilities you can use in your code or to study.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
543 B

import dbc
import traceback
print("---- CHECK ---")
try:
dbc.check(1 == 2, "Check Failed!")
except dbc.CheckError as e:
print("Check failure:", e)
print("---- SENTINEL ---")
try:
dbc.sentinel()
except dbc.SentinelError as e:
print("Sentinel failure:", e)
print("---- PRECOND ---")
try:
dbc.pre(1 == 2, "Pre Failed!")
except dbc.PreError as e:
print("Pre condition failure: ", e)
print("---- POSTCOND ---")
try:
dbc.post(1 == 2, "Post Failed!")
except dbc.PostError as e:
print("Post condition failure:", e)