mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00

* Variables of `string` type can now be set to an empty string * Trying to set a variable with non-`string` type to an empty value now emits an error instead of silently doing nothing * Providing an invalid identifier now emits an "unknown identifier" error instead of silently doing nothing
27 lines
739 B
Text
27 lines
739 B
Text
# @TEST-EXEC: zeek -b %INPUT mynum=0 mytable='{["one"] = "1"}' mystr="" MyMod::str="Good" >1.out
|
|
# @TEST-EXEC: zeek -b %INPUT mynum=0 mytable+='{["one"] = "1"}' >2.out
|
|
|
|
# @TEST-EXEC-FAIL: zeek -b %INPUT no_such_var=13 >3.out 2>&1
|
|
# @TEST-EXEC-FAIL: zeek -b %INPUT mynum="" mytable="" >4.out 2>&1
|
|
|
|
# @TEST-EXEC: btest-diff 1.out
|
|
# @TEST-EXEC: btest-diff 2.out
|
|
# @TEST-EXEC: btest-diff 3.out
|
|
# @TEST-EXEC: btest-diff 4.out
|
|
|
|
const mynum: count &redef;
|
|
const mytable: table[string] of string = {["zero"] = "0"} &redef;
|
|
option mystr="default";
|
|
|
|
module MyMod;
|
|
export { option str="def"; }
|
|
module GLOBAL;
|
|
|
|
event zeek_init()
|
|
{
|
|
print "mystr", mystr;
|
|
print "mynum", mynum;
|
|
print "mytable", to_json(mytable);
|
|
print "MyMod::str", MyMod::str;
|
|
}
|
|
|