zeek/testing/btest/bifs/to_int.zeek
Benjamin Bannier 742f17fb15 Baseline handling of leading/trailing spaces in to_count/to_int.
Currently `to_count` reports an error for trailing spaces (but not for
leading ones) while `to_int` silently accepts them. This patch adds
baselines capture the current behavior.
2025-02-18 14:01:53 +01:00

26 lines
605 B
Text

# @TEST-EXEC: zeek -b %INPUT 1>out 2>err
# @TEST-EXEC: btest-diff out
# @TEST-EXEC: TEST_DIFF_CANONIFIER=${SCRIPTS}/diff-remove-abspath btest-diff err
event zeek_init()
{
print to_int("1");
print to_int("-1");
print to_int("4294967296");
print to_int("not an int");
# We automatically trim leading, but not trailing whitespace.
print to_int(" 205"); # Okay.
print to_int("206 "); # Error.
local a: double = 3.14;
print double_to_int(a);
local b: double = 3.9;
print double_to_int(b);
local c: double = -3.14;
print double_to_int(c);
local d: double = -3.9;
print double_to_int(d);
}