mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00

@vpax reported surprising behavior when working with "void values". While these are not exposed to script land, plumb the places he pointed out are causing confusing behavior. Closes #3640.
43 lines
760 B
Text
43 lines
760 B
Text
# @TEST-DOC: Zeek does not have a script land void type, but internally it does exist (indexing a set, or a function returning no result). Regression test #3640.
|
|
#
|
|
# @TEST-EXEC-FAIL: zeek -b %INPUT >output 2>&1
|
|
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff output
|
|
|
|
# identifier void not defined...
|
|
global x: void = 1;
|
|
|
|
# @TEST-START-NEXT
|
|
type R: record {
|
|
x: void;
|
|
};
|
|
|
|
|
|
# @TEST-START-NEXT
|
|
function x(): void {
|
|
return "a";
|
|
};
|
|
|
|
# @TEST-START-NEXT
|
|
function x() {
|
|
return "a";
|
|
};
|
|
|
|
# @TEST-START-NEXT
|
|
|
|
global x = set(3.4.5.6, 9.8.7.6);
|
|
print |x|;
|
|
print |x[3.4.5.6]|;
|
|
|
|
# @TEST-START-NEXT
|
|
local x = set(5, 3);
|
|
local y: any = x[3];
|
|
print y;
|
|
|
|
# @TEST-START-NEXT
|
|
function x() {
|
|
print "x()";
|
|
}
|
|
|
|
global z: any = x();
|
|
print x();
|
|
print |x()|;
|