mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 01:58:20 +00:00

* origin/topic/johanna/bit-1976: Allow event/function definitions to be wrapped in directives. Fixed to work with attributes (e.g. &priority).
51 lines
541 B
Text
51 lines
541 B
Text
# @TEST-EXEC: bro -b %INPUT >out
|
|
# @TEST-EXEC: btest-diff out
|
|
# Check if @if can be used to alternative function/event definitions
|
|
|
|
@if ( 1==1 )
|
|
function test_case(msg: string)
|
|
@else
|
|
lalala
|
|
@endif
|
|
{
|
|
print msg;
|
|
}
|
|
|
|
@if ( 1==1 )
|
|
event bro_init()
|
|
@else
|
|
lalala
|
|
@endif
|
|
{
|
|
print "1";
|
|
test_case("2");
|
|
}
|
|
|
|
@if ( 1==0 )
|
|
lalala
|
|
@else
|
|
event bro_init()
|
|
@endif
|
|
{
|
|
print "3";
|
|
}
|
|
|
|
@if ( 1==1 )
|
|
@if ( 1==1 )
|
|
event bro_init()
|
|
@endif
|
|
@else
|
|
lalala
|
|
@endif
|
|
{
|
|
print "4";
|
|
}
|
|
|
|
@if ( 1==1 )
|
|
event bro_init() &priority=10
|
|
@else
|
|
lalala
|
|
@endif
|
|
{
|
|
print "0";
|
|
}
|