mirror of
https://github.com/zeek/zeek.git
synced 2025-10-12 03:28:19 +00:00
27 lines
544 B
Text
27 lines
544 B
Text
# @TEST-DOC: Adapt in v7.1 to check for errors upon GLOBAL accesses.
|
|
|
|
# @TEST-EXEC: zeek -b %INPUT >out
|
|
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff out
|
|
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff .stderr
|
|
|
|
module GLOBAL;
|
|
|
|
function test_function() { }
|
|
|
|
global X = 42;
|
|
|
|
|
|
module MyModule;
|
|
|
|
global X = fmt("shadows ::X (%s)", ::X);
|
|
|
|
event zeek_init()
|
|
{
|
|
test_function();
|
|
::test_function();
|
|
GLOBAL::test_function();
|
|
|
|
print "X", X;
|
|
print "::X", ::X;
|
|
print "GLOBAL::X", GLOBAL::X;
|
|
}
|