associated btest

This commit is contained in:
Vern Paxson 2022-02-28 17:38:32 -08:00
parent c77f543a17
commit b3ff872bd7
2 changed files with 34 additions and 0 deletions

View file

@ -0,0 +1,3 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
error in <...>/record-bad-ctor4.zeek, line 29: mandatory field "cnt" missing (info2($str=hello))
error in <...>/record-bad-ctor4.zeek, line 29: mandatory field "a" missing ([$str=hello])

View file

@ -0,0 +1,31 @@
# @TEST-EXEC-FAIL: zeek -b %INPUT >out 2>&1
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff out
# Named record constructors should include values for every non-optional,
# non-aggregate field.
type info1 : record {
str: string;
cnt: count &optional;
a: addr &optional;
v: vector of bool;
r: record { x: count; };
s: set[bool];
t: table[bool] of string;
};
type info2 : record {
str: string;
cnt: count;
a: addr;
};
event zeek_init()
{
local resp1 = info1($str="hello");
print resp1;
local resp2 = info2($str="hello");
print resp2;
}