mirror of
https://github.com/zeek/zeek.git
synced 2025-10-17 22:18:20 +00:00
Added Jon's test cases as unit tests
This commit is contained in:
parent
3efbea0b84
commit
6fcb23066d
4 changed files with 64 additions and 0 deletions
|
@ -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
|
|
@ -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
|
|
@ -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]);
|
||||||
|
}
|
|
@ -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")]);
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue