mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 15:48:19 +00:00
Fix val_size BIF tests and improve docs
Improve documentation of "order" BIF, and made the "val_size" tests more portable.
This commit is contained in:
parent
83dcbd4aa7
commit
18e61fcdfc
4 changed files with 13 additions and 10 deletions
|
@ -1494,6 +1494,8 @@ function sort%(v: any, ...%) : any
|
||||||
## v: The vector whose order to compute.
|
## v: The vector whose order to compute.
|
||||||
##
|
##
|
||||||
## Returns: A ``vector of count`` with the indices of the ordered elements.
|
## Returns: A ``vector of count`` with the indices of the ordered elements.
|
||||||
|
## For example, the elements of *v* in order are (assuming ``o``
|
||||||
|
## is the vector returned by ``order``): v[o[0]], v[o[1]], etc.
|
||||||
##
|
##
|
||||||
## .. bro:see:: sort
|
## .. bro:see:: sort
|
||||||
function order%(v: any, ...%) : index_vec
|
function order%(v: any, ...%) : index_vec
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
72
|
|
||||||
72
|
|
|
@ -22,7 +22,6 @@ function myfunc2(a: double, b: double): int
|
||||||
|
|
||||||
event bro_init()
|
event bro_init()
|
||||||
{
|
{
|
||||||
# TODO: these results don't make sense
|
|
||||||
|
|
||||||
# Tests without supplying a comparison function
|
# Tests without supplying a comparison function
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,16 @@
|
||||||
#
|
#
|
||||||
# @TEST-EXEC: bro %INPUT > out
|
# @TEST-EXEC: bro %INPUT
|
||||||
# @TEST-EXEC: btest-diff out
|
|
||||||
|
|
||||||
event bro_init()
|
event bro_init()
|
||||||
{
|
{
|
||||||
local a = 1;
|
local a = T;
|
||||||
local b = T;
|
local b = 12;
|
||||||
|
local c: table[string] of addr = { ["a"] = 192.168.0.2, ["b"] = 10.0.0.2 };
|
||||||
|
|
||||||
|
if ( val_size(a) > val_size(b) )
|
||||||
|
exit(1);
|
||||||
|
|
||||||
|
if ( val_size(b) > val_size(c) )
|
||||||
|
exit(1);
|
||||||
|
|
||||||
print val_size(a);
|
|
||||||
print val_size(b);
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue