mirror of
https://github.com/zeek/zeek.git
synced 2025-10-06 16:48:19 +00:00
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:
parent
a25b1a9d59
commit
25ea678626
41 changed files with 635 additions and 3 deletions
27
testing/btest/language/assert-error.zeek
Normal file
27
testing/btest/language/assert-error.zeek
Normal file
|
@ -0,0 +1,27 @@
|
|||
# @TEST-DOC: Assert statement wrong usage
|
||||
#
|
||||
# @TEST-EXEC-FAIL: zeek -b %INPUT
|
||||
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff .stderr
|
||||
|
||||
event zeek_init()
|
||||
{
|
||||
assert 1;
|
||||
}
|
||||
|
||||
@TEST-START-NEXT
|
||||
event zeek_init()
|
||||
{
|
||||
assert T, 1234;
|
||||
}
|
||||
|
||||
@TEST-START-NEXT
|
||||
event zeek_init()
|
||||
{
|
||||
assert;
|
||||
}
|
||||
|
||||
@TEST-START-NEXT
|
||||
event zeek_init()
|
||||
{
|
||||
assert T, "extra", "something";
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue