zeek/testing/btest/language/when-unitialized-rhs.zeek
Robin Sommer 789cb376fd GH-239: Rename bro to zeek, bro-config to zeek-config, and bro-path-dev to zeek-path-dev.
This also installs symlinks from "zeek" and "bro-config" to a wrapper
script that prints a deprecation warning.

The btests pass, but this is still WIP. broctl renaming is still
missing.

#239
2019-05-01 21:43:45 +00:00

32 lines
611 B
Text

# @TEST-EXEC: zeek -b -r $TRACES/wikipedia.trace %INPUT >out 2>&1
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff out
global crashMe: function(): string;
global x: int;
event zeek_init()
{
when( local result = crashMe() )
{
print "1st when stmt executing", result;
}
when( local other_result = x )
{
print "2nd when stmt executing", other_result;
}
}
global conn_count = 0;
event new_connection(c: connection)
{
++conn_count;
print conn_count;
if ( conn_count == 10 )
{
x = 999;
crashMe = function(): string { return "not anymore you don't"; };
}
}