zeek/testing/btest/language/record-recursive-coercion.zeek
Jon Siwek a994be9eeb Merge remote-tracking branch 'origin/topic/seth/zeek_init'
* origin/topic/seth/zeek_init:
  Some more testing fixes.
  Update docs and tests for bro_(init|done) -> zeek_(init|done)
  Implement the zeek_init handler.
2019-04-19 11:24:29 -07:00

40 lines
843 B
Text

# @TEST-EXEC: bro -b %INPUT >output
# @TEST-EXEC: btest-diff output
type Version: record {
major: count &optional;
minor: count &optional;
minor2: count &optional;
addl: string &optional;
};
type Info: record {
name: string;
version: Version;
};
global matched_software: table[string] of Info = {
["OpenSSH_4.4"] = [$name="OpenSSH", $version=[$major=4,$minor=4]],
};
type Foo: record {
i: interval &default=1hr;
s: string &optional;
};
type FooContainer: record {
c: count;
f: Foo &optional;
};
function foo_func(fc: FooContainer)
{
print fc;
}
event zeek_init()
{
for ( sw in matched_software )
print matched_software[sw]$version;
foo_func([$c=1, $f=[$i=2hrs]]);
}