mirror of
https://github.com/zeek/zeek.git
synced 2025-10-14 20:48:21 +00:00
update existing test suite usage of "when" statements to include captures
This commit is contained in:
parent
98cd3f2213
commit
b59ee83979
6 changed files with 9 additions and 9 deletions
|
@ -22,7 +22,7 @@ redef exit_only_after_terminate=T;
|
|||
event on_demand_key()
|
||||
{
|
||||
local host = 1.2.3.4;
|
||||
when ( local result = SumStats::request_key("test", [$host=host]) )
|
||||
when [host] ( local result = SumStats::request_key("test", [$host=host]) )
|
||||
{
|
||||
print fmt("Key request for %s", host);
|
||||
print fmt(" Host: %s -> %.0f", host, result["test.reducer"]$sum);
|
||||
|
|
|
@ -23,7 +23,7 @@ function check_exit_condition()
|
|||
|
||||
function test_request(label: string, req: ActiveHTTP::Request)
|
||||
{
|
||||
when ( local response = ActiveHTTP::request(req) )
|
||||
when [label, req] ( local response = ActiveHTTP::request(req) )
|
||||
{
|
||||
print label, response;
|
||||
check_exit_condition();
|
||||
|
|
|
@ -19,7 +19,7 @@ function check_exit_condition()
|
|||
|
||||
function test_cmd(label: string, cmd: Exec::Command)
|
||||
{
|
||||
when ( local result = Exec::run(cmd) )
|
||||
when [label, cmd] ( local result = Exec::run(cmd) )
|
||||
{
|
||||
local file_content = "";
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue