mirror of
https://github.com/zeek/zeek.git
synced 2025-10-15 13:08:20 +00:00

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.
26 lines
605 B
Text
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);
|
|
}
|