zeek/testing/btest/language/blank-local.zeek
Arne Welzel 46334f8b59 Introduce special treatment for the blank identifier _
Mostly: Do not instantiate variables within for loops and allow
reusing differently typed blanks which previously wasn't possible.

This may be missing some corner-cases, but the added tests seem
to work as expected and nothing else fell apart it seems.
2022-10-24 10:36:01 +02:00

29 lines
496 B
Text

# @TEST-DOC: Locals work with the blank identifier, but can not be referenced.
# @TEST-EXEC: zeek -b %INPUT
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff .stderr
event zeek_init()
{
local _ = "1";
}
#@TEST-START-NEXT
event zeek_init()
{
local _: string = "1";
local _: count = 1;
}
#@TEST-START-NEXT
event zeek_init()
{
local _: string = "1";
const _: count = 1;
}
#@TEST-START-NEXT
event zeek_init()
{
const _: string = "1";
const _: count = 1;
}