zeek/testing/btest/language/for-var-check.zeek
Robin Sommer f40ca42590 Merge branch 'topic/amazingpp/modifiable-const-via-loops' of ssh://github.com/AmazingPP/zeek
Edits: Slight tweaking, plus a simple test.

* 'topic/amazingpp/modifiable-const-via-loops' of ssh://github.com/AmazingPP/zeek:
  Add help function to check loop variable
  Fix local const variables can be modified via loops
2022-07-19 14:26:59 +02:00

13 lines
253 B
Text

# @TEST-EXEC-FAIL: zeek -b %INPUT >out 2>&1
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff out
global x: count = 0;
event zeek_init()
{
const y: count = 0;
for ( x in set(1, 2, 3) ) {}
for ( y in set(1, 2, 3) ) {}
}