mirror of
https://github.com/zeek/zeek.git
synced 2025-10-07 17:18:20 +00:00

Without this patch, this scenario results in a segmentation fault. I opted to keep the separator present for non-existing elements. Hence, a vector a, [empty], b with separator "|" will result in a||b
25 lines
622 B
Text
25 lines
622 B
Text
#
|
|
# @TEST-EXEC: bro -b %INPUT >out
|
|
# @TEST-EXEC: btest-diff out
|
|
|
|
event bro_init()
|
|
{
|
|
local a: string_array = {
|
|
[1] = "this", [2] = "is", [3] = "a", [4] = "test"
|
|
};
|
|
local b: string_array = { [1] = "mytest" };
|
|
local c: string_vec = vector( "this", "is", "another", "test" );
|
|
local d: string_vec = vector( "Test" );
|
|
local e: string_vec = vector();
|
|
e[3] = "hi";
|
|
e[5] = "there";
|
|
|
|
print join_string_array(" * ", a);
|
|
print join_string_array("", a);
|
|
print join_string_array("x", b);
|
|
|
|
print join_string_vec(c, "__");
|
|
print join_string_vec(c, "");
|
|
print join_string_vec(d, "-");
|
|
print join_string_vec(e, ".");
|
|
}
|