Add &ordered attribute for tables/sets

This commit is contained in:
Tim Wojtulewicz 2022-10-11 13:35:30 -07:00
parent e3682a09e0
commit bd7df9e2bf
9 changed files with 56 additions and 6 deletions

View file

@ -0,0 +1 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.

View file

@ -0,0 +1,7 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
2
1
3
1
2
3

View 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);
}
}