zeek/testing/btest/language/on_change.test
Jon Siwek 7967a5b0aa General btest cleanup
- Use `-b` most everywhere, it will save time.

- Start some intel tests upon the input file being fully read instead of
  at an arbitrary time.

- Improve termination condition for some sumstats/cluster tests.

- Filter uninteresting output from some supervisor tests.

- Test for `notice_policy.log` is no longer needed.
2020-08-11 11:26:22 -07:00

29 lines
638 B
Text

# @TEST-EXEC: zeek -b %INPUT >output
# @TEST-EXEC: btest-diff output
module TestModule;
function change_function(t: table[string, int] of count, tpe: TableChange, idxa: string, idxb: int, val: count)
{
print "change_function", idxa, idxb, val, tpe;
}
function set_change(t: set[string], tpe: TableChange, idx: string)
{
print "set_change", idx, tpe;
}
global t: table[string, int] of count &on_change=change_function;
global s: set[string] &on_change=set_change;
event zeek_init()
{
print "inserting";
t["a", 1] = 5;
add s["hi"];
print "changing";
t["a", 1] = 2;
print "deleting";
delete t["a", 1];
delete s["hi"];
}