mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 07:38:19 +00:00
GH-1558: Fix reading vector of enum
types from config files
This commit is contained in:
parent
e35888a994
commit
45b2d3b4f2
4 changed files with 35 additions and 1 deletions
|
@ -6,6 +6,9 @@
|
|||
@TEST-START-FILE configfile
|
||||
mycolors Red,asdf,Blue
|
||||
nocolors
|
||||
color_vec Green
|
||||
bad_color_vec Green,1234,Blue
|
||||
no_color_vec
|
||||
@TEST-END-FILE
|
||||
|
||||
@load base/frameworks/config
|
||||
|
@ -15,6 +18,10 @@ type Color: enum { Red, Green, Blue, };
|
|||
option mycolors = set(Red, Green);
|
||||
option nocolors = set(Red, Green);
|
||||
|
||||
option color_vec: vector of Color = { Red };
|
||||
option bad_color_vec: vector of Color = { Red };
|
||||
option no_color_vec: vector of Color = { Red };
|
||||
|
||||
event zeek_init()
|
||||
{ Config::read_config("../configfile"); }
|
||||
|
||||
|
@ -22,5 +29,8 @@ event Input::end_of_data(name: string, source:string)
|
|||
{
|
||||
print mycolors;
|
||||
print nocolors;
|
||||
print color_vec;
|
||||
print bad_color_vec;
|
||||
print no_color_vec;
|
||||
terminate();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue