mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
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.
This commit is contained in:
parent
4c4cd5984c
commit
742f17fb15
5 changed files with 12 additions and 1 deletions
|
@ -1,4 +1,5 @@
|
||||||
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
|
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
|
||||||
error in <...>/to_count.zeek, line 8: bad conversion to count (int_to_count(a) and -2)
|
error in <...>/to_count.zeek, line 8: bad conversion to count (int_to_count(a) and -2)
|
||||||
error in <...>/to_count.zeek, line 20: bad conversion to count (to_count() and )
|
error in <...>/to_count.zeek, line 20: bad conversion to count (to_count() and )
|
||||||
error in <...>/to_count.zeek, line 22: bad conversion to count (to_count(not a count) and not a count)
|
error in <...>/to_count.zeek, line 24: bad conversion to count (to_count(206 ) and 206 )
|
||||||
|
error in <...>/to_count.zeek, line 25: bad conversion to count (to_count(not a count) and not a count)
|
||||||
|
|
|
@ -6,6 +6,8 @@
|
||||||
7
|
7
|
||||||
0
|
0
|
||||||
18446744073709551611
|
18446744073709551611
|
||||||
|
205
|
||||||
|
0
|
||||||
0
|
0
|
||||||
123
|
123
|
||||||
9223372036854775808 and 9223372036854775808 are the same
|
9223372036854775808 and 9223372036854775808 are the same
|
||||||
|
|
|
@ -3,6 +3,8 @@
|
||||||
-1
|
-1
|
||||||
4294967296
|
4294967296
|
||||||
0
|
0
|
||||||
|
205
|
||||||
|
206
|
||||||
3
|
3
|
||||||
4
|
4
|
||||||
-3
|
-3
|
||||||
|
|
|
@ -19,6 +19,9 @@ event zeek_init()
|
||||||
print to_count("7");
|
print to_count("7");
|
||||||
print to_count("");
|
print to_count("");
|
||||||
print to_count("-5");
|
print to_count("-5");
|
||||||
|
# We automatically trim leading, but not trailing whitespace.
|
||||||
|
print to_count(" 205"); # Okay.
|
||||||
|
print to_count("206 "); # Error.
|
||||||
print to_count("not a count");
|
print to_count("not a count");
|
||||||
|
|
||||||
local e: port = 123/tcp;
|
local e: port = 123/tcp;
|
||||||
|
|
|
@ -8,6 +8,9 @@ event zeek_init()
|
||||||
print to_int("-1");
|
print to_int("-1");
|
||||||
print to_int("4294967296");
|
print to_int("4294967296");
|
||||||
print to_int("not an int");
|
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;
|
local a: double = 3.14;
|
||||||
print double_to_int(a);
|
print double_to_int(a);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue