Stmt: Introduce assert statement and related hooks

including two hooks called assertion_failure() and assertion_result() for
customization and tracking of assertion results.
This commit is contained in:
Arne Welzel 2023-06-05 19:13:14 +02:00
parent a25b1a9d59
commit 25ea678626
41 changed files with 635 additions and 3 deletions

View file

@ -0,0 +1,3 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
error in <...>/assert-hook.zeek, line 12: assertion failure: 2 + 2 == 5 (this is false)
error in <...>/assert-hook.zeek, line 18: assertion failure: 2 + 2 == 5 (this is false)

View file

@ -0,0 +1,5 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
assertion_result, T, 2 + 2 == 4, this is true, <...>/assert-hook.zeek, 10
assertion_result, T, 2 + 2 == 4, {"msg":"this is also true"}, <...>/assert-hook.zeek, 11
assertion_result, F, 2 + 2 == 5, this is false, <...>/assert-hook.zeek, 12
assertion_result, F, 2 + 2 == 5, this is false, <...>/assert-hook.zeek, 18