zeek/testing/btest/language/record-recursive-coercion.zeek
Robin Sommer 789cb376fd GH-239: Rename bro to zeek, bro-config to zeek-config, and bro-path-dev to zeek-path-dev.
This also installs symlinks from "zeek" and "bro-config" to a wrapper
script that prints a deprecation warning.

The btests pass, but this is still WIP. broctl renaming is still
missing.

#239
2019-05-01 21:43:45 +00:00

40 lines
844 B
Text

# @TEST-EXEC: zeek -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]]);
}