mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
associated btest
This commit is contained in:
parent
c77f543a17
commit
b3ff872bd7
2 changed files with 34 additions and 0 deletions
3
testing/btest/Baseline/language.record-bad-ctor4/out
Normal file
3
testing/btest/Baseline/language.record-bad-ctor4/out
Normal 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])
|
31
testing/btest/language/record-bad-ctor4.zeek
Normal file
31
testing/btest/language/record-bad-ctor4.zeek
Normal 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;
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue