mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00

This marks every identifier used within an attribute as seeds. The scenario this avoids is functions referenced through attributes on unused tables or record types (&default, &expire_func, ...) being dinged as unused as that's rather confusing. Also adds test for the above and a light smoke test into language/ as it doesn't appear we had coverage here. Closes #3122
11 lines
413 B
Text
11 lines
413 B
Text
# @TEST-DOC: Simple testing for unused function/event detection to ensure nothing breaks when modifying it.
|
|
# @TEST-EXEC: zeek -b %INPUT
|
|
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff .stderr
|
|
|
|
module MyModule;
|
|
|
|
function gen_id(): string { return cat(rand(10000)); }
|
|
function gen_id2(): string { return gen_id2(); }
|
|
|
|
function helper() { }
|
|
event MyModule::unused(c: count) { helper(); }
|