mirror of
https://github.com/zeek/zeek.git
synced 2025-10-15 13:08:20 +00:00
Add &ordered attribute for tables/sets
This commit is contained in:
parent
e3682a09e0
commit
bd7df9e2bf
9 changed files with 56 additions and 6 deletions
27
testing/btest/language/table-iteration.zeek
Normal file
27
testing/btest/language/table-iteration.zeek
Normal file
|
@ -0,0 +1,27 @@
|
|||
# @TEST-EXEC: zeek -b %INPUT >out
|
||||
# @TEST-EXEC: btest-diff out
|
||||
# @TEST-EXEC: btest-diff .stderr
|
||||
|
||||
global tbl: table[count] of count;
|
||||
global tbl2: table[count] of count &ordered;
|
||||
|
||||
event zeek_init()
|
||||
{
|
||||
local i = 0;
|
||||
while ( i < 3 )
|
||||
{
|
||||
++i;
|
||||
tbl[i] = i;
|
||||
tbl2[i] = i;
|
||||
}
|
||||
|
||||
for ( [k], v in tbl )
|
||||
{
|
||||
print(v);
|
||||
}
|
||||
|
||||
for ( [k], v in tbl2 )
|
||||
{
|
||||
print(v);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue