Added Jon's test cases as unit tests

This commit is contained in:
Dev Bali 2019-07-23 11:59:30 -07:00
parent 3efbea0b84
commit 6fcb23066d
4 changed files with 64 additions and 0 deletions

View file

@ -0,0 +1,10 @@
#separator \x09
#set_separator ,
#empty_field (empty)
#unset_field -
#path test
#open 2019-07-23-11-40-47
#fields s
#types string
foo \x0a\x09\x00 bar
#close 2019-07-23-11-40-47

View file

@ -0,0 +1,10 @@
#separator \x09
#set_separator \xc2\xae
#empty_field (empty)
#unset_field -
#path test
#open 2019-07-23-11-46-43
#fields ss
#types set[string]
\xc2\xae
#close 2019-07-23-11-46-43

View file

@ -0,0 +1,21 @@
#
# @TEST-EXEC: zeek -b %INPUT
# @TEST-EXEC: btest-diff test.log
@load tuning/enable-utf-8-logs
module Test;
export {
redef enum Log::ID += { LOG };
type Log: record {
s: string;
} &log;
}
event zeek_init()
{
local a = "foo \n\t\0 bar";
Log::create_stream(Test::LOG, [$columns=Log]);
Log::write(Test::LOG, [$s=a]);
}

View file

@ -0,0 +1,23 @@
#
# @TEST-EXEC: zeek -b %INPUT
# @TEST-EXEC: btest-diff test.log
@load tuning/enable-utf-8-logs
redef LogAscii::set_separator = "\xc2\xae";
module Test;
export {
redef enum Log::ID += { LOG };
type Log: record {
ss: set[string];
} &log;
}
event zeek_init()
{
Log::create_stream(Test::LOG, [$columns=Log]);
Log::write(Test::LOG, [$ss=set("\xc2\xae")]);
}