mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
updates to btests to support switch to expression-based initialization
This commit is contained in:
parent
f62c04c9eb
commit
64775a8192
20 changed files with 65 additions and 49 deletions
|
@ -1,8 +1,8 @@
|
|||
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
|
||||
{
|
||||
51f3:f001:5b82:e802:c401:6750:7b95:89bb,
|
||||
4cc7:de52:d869:b2f9:f215:19b8:c828:3bdd,
|
||||
7a5f:b783:9808:380e:b1a2:ce20:b58e:2a4a
|
||||
7a5f:b783:9808:380e:b1a2:ce20:b58e:2a4a,
|
||||
4cc7:de52:d869:b2f9:f215:19b8:c828:3bdd
|
||||
}
|
||||
lookup_hostname_txt, fake_text_lookup_result_bro.wp.dg.cx
|
||||
lookup_hostname, {
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
|
||||
warning in <...>/scalar-vector.zeek, line 7: mixing vector and scalar operands is deprecated (string) (vector)
|
||||
warning in <...>/scalar-vector.zeek, line 8: mixing vector and scalar operands is deprecated (vector) (string)
|
||||
warning in <...>/scalar-vector.zeek, line 9: mixing vector and scalar operands is deprecated (string) (vector)
|
||||
warning in <...>/scalar-vector.zeek, line 13: mixing vector and scalar operands is deprecated (count) (vector)
|
||||
warning in <...>/scalar-vector.zeek, line 14: mixing vector and scalar operands is deprecated (count) (vector)
|
||||
warning in <...>/scalar-vector.zeek, line 15: mixing vector and scalar operands is deprecated (vector) (count)
|
||||
warning in <...>/scalar-vector.zeek, line 16: mixing vector and scalar operands is deprecated (vector) (count)
|
||||
warning in <...>/scalar-vector.zeek, line 11: mixing vector and scalar operands is deprecated (string) (vector)
|
||||
warning in <...>/scalar-vector.zeek, line 12: mixing vector and scalar operands is deprecated (vector) (string)
|
||||
warning in <...>/scalar-vector.zeek, line 13: mixing vector and scalar operands is deprecated (string) (vector)
|
||||
warning in <...>/scalar-vector.zeek, line 17: mixing vector and scalar operands is deprecated (count) (vector)
|
||||
warning in <...>/scalar-vector.zeek, line 18: mixing vector and scalar operands is deprecated (count) (vector)
|
||||
warning in <...>/scalar-vector.zeek, line 19: mixing vector and scalar operands is deprecated (vector) (count)
|
||||
warning in <...>/scalar-vector.zeek, line 20: mixing vector and scalar operands is deprecated (vector) (count)
|
||||
[F, T, F]
|
||||
[aa, ba, ca]
|
||||
[aa, ab, ac]
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
|
||||
{
|
||||
[bar, 1.2.0.0/19] ,
|
||||
[foo, 1.2.0.0/19] ,
|
||||
[foo, 5.6.0.0/21] ,
|
||||
[foo, 1.2.0.0/19] ,
|
||||
[bar, 5.6.0.0/21]
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
|
||||
error in <...>/mismatched-container-ctor-types.zeek, line 6: unexpected use of vector constructor in 'table' initialization (vector())
|
||||
error in <...>/mismatched-container-ctor-types.zeek, line 7: unexpected use of table constructor in 'vector' initialization (table())
|
||||
error in <...>/mismatched-container-ctor-types.zeek, line 8: unexpected use of set constructor in 'vector' initialization (set())
|
||||
error in <...>/mismatched-container-ctor-types.zeek, line 9: unexpected use of record constructor in 'vector' initialization ([])
|
||||
error in <...>/mismatched-container-ctor-types.zeek, line 10: unexpected use of record constructor in 'vector' initialization (R())
|
||||
error in <...>/mismatched-container-ctor-types.zeek, line 6: type clash in assignment (t = vector())
|
||||
error in <...>/mismatched-container-ctor-types.zeek, line 7: type clash in assignment (v0 = table())
|
||||
error in <...>/mismatched-container-ctor-types.zeek, line 8: type clash in assignment (v1 = set())
|
||||
error in <...>/mismatched-container-ctor-types.zeek, line 9: type clash in assignment (v2 = [])
|
||||
error in <...>/mismatched-container-ctor-types.zeek, line 10: type clash in assignment (v3 = R())
|
||||
error in <...>/mismatched-container-ctor-types.zeek, line 12: type clash in assignment (lt = vector())
|
||||
error in <...>/mismatched-container-ctor-types.zeek, line 13: type clash in assignment (lv0 = table())
|
||||
error in <...>/mismatched-container-ctor-types.zeek, line 14: type clash in assignment (lv1 = set())
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
|
||||
error in <...>/record-bad-ctor.zeek, line 6: no type given (asdfasdf)
|
||||
error in <...>/record-bad-ctor.zeek, line 7: non-optional field "ports" missing in initialization ([ports=<uninitialized>])
|
||||
expression error in <...>/record-bad-ctor.zeek, line 11: value used but not set (asdfasdf2)
|
||||
error in <...>/record-bad-ctor.zeek, line 11: initialization failed (blah2)
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
|
||||
error in port and <...>/record-type-checking.zeek, line 9: arithmetic mixed with non-arithmetic (port and 0)
|
||||
error in <...>/record-type-checking.zeek, line 9: bad record initializer ([$a=<error>])
|
||||
error in port and <...>/record-type-checking.zeek, line 12: arithmetic mixed with non-arithmetic (port and 1)
|
||||
error in <...>/record-type-checking.zeek, line 12: bad record initializer ((coerce [$a=<error>] to error))
|
||||
error in port and <...>/record-type-checking.zeek, line 18: arithmetic mixed with non-arithmetic (port and 2)
|
||||
error in <...>/record-type-checking.zeek, line 22 and count: type clash for field "a" ((coerce [$a=3] to MyRec) and count)
|
||||
error in <...>/record-type-checking.zeek, line 22: bad record initializer ((coerce [$a=3] to error))
|
||||
error in port and <...>/record-type-checking.zeek, line 27: arithmetic mixed with non-arithmetic (port and 1000)
|
||||
error in port and <...>/record-type-checking.zeek, line 33: arithmetic mixed with non-arithmetic (port and 1001)
|
||||
error in port and <...>/record-type-checking.zeek, line 40: arithmetic mixed with non-arithmetic (port and 1002)
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
|
||||
warning in /Users/vern/warehouse/zeek/master/testing/btest/.tmp/language.redef-same-prefixtable-idx/redef-same-prefixtable-idx.zeek, line 7: initialization not preceded by =/+=/-= is deprecated (3.0.0.0/8 = 1.0.0.0/8)
|
||||
warning in /Users/vern/warehouse/zeek/master/testing/btest/.tmp/language.redef-same-prefixtable-idx/redef-same-prefixtable-idx.zeek, line 8: initialization not preceded by =/+=/-= is deprecated (3.0.0.0/8 = 2.0.0.0/8)
|
|
@ -8,8 +8,10 @@ error in <...>/set-type-checking.zeek, line 10: inconsistent type in set constru
|
|||
error in port and <...>/set-type-checking.zeek, line 16: arithmetic mixed with non-arithmetic (port and 2)
|
||||
error in <...>/set-type-checking.zeek, line 16 and port: type mismatch (2 and port)
|
||||
error in <...>/set-type-checking.zeek, line 16: inconsistent type in set constructor (set(2))
|
||||
error in port: arithmetic mixed with non-arithmetic (port and 3)
|
||||
error in <...>/set-type-checking.zeek, line 20: initialization type mismatch in set (set(3) and 3)
|
||||
error in port and <...>/set-type-checking.zeek, line 20: arithmetic mixed with non-arithmetic (port and 3)
|
||||
error in <...>/set-type-checking.zeek, line 20 and port: type mismatch (3 and port)
|
||||
error in <...>/set-type-checking.zeek, line 20: inconsistent type in set constructor (set(3))
|
||||
error in <...>/set-type-checking.zeek, line 20: type clash in assignment (gea = set(3))
|
||||
error in port and <...>/set-type-checking.zeek, line 25: arithmetic mixed with non-arithmetic (port and 1000)
|
||||
error in <...>/set-type-checking.zeek, line 25 and port: type mismatch (1000 and port)
|
||||
error in <...>/set-type-checking.zeek, line 25: inconsistent type in set constructor (set(1000))
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
|
||||
error in <...>/table-aggr-init-type-check.zeek, line 21: type mismatch in table value initialization: assigning 'types' to table with values of type 'record' (three = 1, 2)
|
||||
error in <...>/table-aggr-init-type-check.zeek, line 25: type mismatch in table value initialization: incompatible record types (four = [$b=No.])
|
||||
error in <...>/table-aggr-init-type-check.zeek, lines 4-7 and <...>/table-aggr-init-type-check.zeek, line 21: type clash (MyRec and 1, 2)
|
||||
error in <...>/table-aggr-init-type-check.zeek, line 21: inconsistent types in table constructor (table(three = 1, 2))
|
||||
error in <...>/table-aggr-init-type-check.zeek, lines 4-7 and <...>/table-aggr-init-type-check.zeek, line 25: incompatible record types (MyRec and [$b=No.])
|
||||
error in <...>/table-aggr-init-type-check.zeek, line 25: inconsistent types in table constructor (table(four = [$b=No.]))
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
|
||||
error in count and <...>/table-list-assign-type-check.zeek, line 16: arithmetic mixed with non-arithmetic (count and Internal Web Server)
|
||||
error in <...>/table-list-assign-type-check.zeek, lines 15-20: inconsistent types in table constructor (table(www, 80 = Internal Web Server, dns1, 53 = Internal DNS 1, dns2, 53 = Internal DNS 2, dhcp-for-wifi, 443 = DHCP Management interface for WiFi))
|
||||
error in <...>/table-list-assign-type-check.zeek, lines 15-20: type clash in assignment (service_table_bad_yield = table(www, 80 = Internal Web Server, dns1, 53 = Internal DNS 1, dns2, 53 = Internal DNS 2, dhcp-for-wifi, 443 = DHCP Management interface for WiFi))
|
||||
error in count and <...>/table-list-assign-type-check.zeek, line 24: arithmetic mixed with non-arithmetic (count and 80)
|
||||
error in <...>/table-list-assign-type-check.zeek, lines 23-28: inconsistent types in table constructor (table(www, 80 = Internal Web Server, dns1, 53 = Internal DNS 1, dns2, 53 = Internal DNS 2, dhcp-for-wifi, 443 = DHCP Management interface for WiFi))
|
||||
error in <...>/table-list-assign-type-check.zeek, lines 23-28: type clash in assignment (service_table_bad_index = table(www, 80 = Internal Web Server, dns1, 53 = Internal DNS 1, dns2, 53 = Internal DNS 2, dhcp-for-wifi, 443 = DHCP Management interface for WiFi))
|
||||
error in string and <...>/table-list-assign-type-check.zeek, line 31: arithmetic mixed with non-arithmetic (string and 1)
|
||||
error in <...>/table-list-assign-type-check.zeek, line 31 and string: type mismatch (1 and string)
|
||||
error in <...>/table-list-assign-type-check.zeek, line 31: inconsistent type in set constructor (set(1, 2, 3))
|
||||
error in <...>/table-list-assign-type-check.zeek, line 31: type clash in assignment (test_set_bad = set(1, 2, 3))
|
||||
|
|
|
@ -4,8 +4,7 @@ error in <...>/table-type-checking.zeek, line 7: inconsistent types in table con
|
|||
error in port and <...>/table-type-checking.zeek, line 10: type clash (port and one)
|
||||
error in <...>/table-type-checking.zeek, line 10: inconsistent types in table constructor (table(one = 1))
|
||||
error in <...>/table-type-checking.zeek, line 17: type clash in assignment (gda = gda2)
|
||||
error in <...>/table-type-checking.zeek, line 21 and <...>/table-type-checking.zeek, line 4: index type doesn't match table (three and list of port)
|
||||
expression error in <...>/table-type-checking.zeek, line 21: type clash in table assignment (three = 3)
|
||||
error in <...>/table-type-checking.zeek, line 21: type clash in assignment (gea = table(three = 3))
|
||||
error in port and <...>/table-type-checking.zeek, line 26: type clash (port and thousand)
|
||||
error in <...>/table-type-checking.zeek, line 26: inconsistent types in table constructor (table(thousand = 1000))
|
||||
error in port and <...>/table-type-checking.zeek, line 32: type clash (port and thousand-one)
|
||||
|
|
|
@ -6,8 +6,7 @@ error in count and <...>/vector-type-checking.zeek, line 10: arithmetic mixed wi
|
|||
error in <...>/vector-type-checking.zeek, line 10 and count: type mismatch (one and count)
|
||||
error in <...>/vector-type-checking.zeek, line 10: inconsistent types in vector constructor (vector(one))
|
||||
error in <...>/vector-type-checking.zeek, line 17: type clash in assignment (gda = gda2)
|
||||
error in count and <...>/vector-type-checking.zeek, line 21: arithmetic mixed with non-arithmetic (count and three)
|
||||
error in <...>/vector-type-checking.zeek, line 21: initialization type mismatch at index 0 (vector(three) and three)
|
||||
error in <...>/vector-type-checking.zeek, line 21: type clash in assignment (gea = vector(three))
|
||||
error in count and <...>/vector-type-checking.zeek, line 26: arithmetic mixed with non-arithmetic (count and thousand)
|
||||
error in <...>/vector-type-checking.zeek, line 26 and count: type mismatch (thousand and count)
|
||||
error in <...>/vector-type-checking.zeek, line 26: inconsistent types in vector constructor (vector(thousand))
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# @TEST-EXEC: ZEEK_DNS_FAKE=1 zeek -b %INPUT >out
|
||||
# @TEST-EXEC: ZEEK_DNS_FAKE=1 zeek -D -b %INPUT >out
|
||||
# @TEST-EXEC: btest-diff out
|
||||
|
||||
redef exit_only_after_terminate = T;
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
# Skip this test when using ZAM, as it will generate a hard error in addition
|
||||
# to the warning.
|
||||
# @TEST-REQUIRES: test "${ZEEK_ZAM}" != "1"
|
||||
#
|
||||
# @TEST-EXEC: zeek -b %INPUT > out 2>&1
|
||||
# @TEST-EXEC: TEST_DIFF_CANONIFIER="$SCRIPTS/diff-remove-abspath" btest-diff out
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# @TEST-EXEC: zeek -b %INPUT >output 2>&1
|
||||
# @TEST-EXEC: zeek -b -D %INPUT >output 2>&1
|
||||
# @TEST-EXEC: btest-diff output
|
||||
|
||||
global my_subs = { 1.2.3.4/19, 5.6.7.8/21 };
|
||||
|
|
|
@ -5,4 +5,9 @@
|
|||
|
||||
global asdfasdf;
|
||||
const blah = [$ports=asdfasdf];
|
||||
print blah;
|
||||
const x = blah;
|
||||
|
||||
global asdfasdf2: port;
|
||||
const blah2 = [$ports=asdfasdf2];
|
||||
|
||||
print blah, blah2;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
# @TEST-EXEC: zeek -b %INPUT >out
|
||||
# @TEST-EXEC: btest-diff .stderr
|
||||
# @TEST-EXEC: btest-diff out
|
||||
|
||||
const my_table: table[subnet] of subnet &redef;
|
||||
|
|
|
@ -11,7 +11,7 @@ redef my_set_ctor_init += {
|
|||
"test3",
|
||||
};
|
||||
|
||||
redef my_set_ctor_init += set("test4");
|
||||
redef my_set_ctor_init += { "test4" };
|
||||
|
||||
const my_table_ctor_init: table[count] of string = table([1] = "test1") &redef &default="nope";
|
||||
|
||||
|
@ -29,7 +29,7 @@ redef my_set_init += {
|
|||
"test3",
|
||||
};
|
||||
|
||||
redef my_set_init += set("test4");
|
||||
redef my_set_init += { "test4" };
|
||||
|
||||
const my_table_init: table[count] of string = { [1] = "test1" } &redef &default="nope";
|
||||
|
||||
|
@ -38,7 +38,7 @@ redef my_table_init += {
|
|||
[3] = "test3",
|
||||
};
|
||||
|
||||
redef my_table_init += table([4] = "test4");
|
||||
redef my_table_init += { [4] = "test4" };
|
||||
|
||||
# For tables that yield tables, we can apply attributes to the both other and
|
||||
# inner tables...
|
||||
|
|
|
@ -15,26 +15,26 @@ local string_records: set[string, MyRec] = set();
|
|||
local record_strings: set[MyRec, string] = set();
|
||||
|
||||
# These are all valid.
|
||||
["asdf"] in strings;
|
||||
["hi", 0] in string_counts;
|
||||
myrec in records;
|
||||
[myrec] in records;
|
||||
MyRec() in records;
|
||||
[$a = 2] in records;
|
||||
[MyRec()] in records;
|
||||
[[$a = 2]] in records;
|
||||
["hi", myrec] in string_records;
|
||||
print ["asdf"] in strings;
|
||||
print ["hi", 0] in string_counts;
|
||||
print myrec in records;
|
||||
print [myrec] in records;
|
||||
print MyRec() in records;
|
||||
print [$a = 2] in records;
|
||||
print [MyRec()] in records;
|
||||
print [[$a = 2]] in records;
|
||||
print ["hi", myrec] in string_records;
|
||||
|
||||
# All below should fail type-checking.
|
||||
|
||||
myrec in "asdf";
|
||||
myrec in string_records;
|
||||
myrec in record_strings;
|
||||
print myrec in "asdf";
|
||||
print myrec in string_records;
|
||||
print myrec in record_strings;
|
||||
|
||||
# Patterns do not apply transparently to collections of strings, so fail
|
||||
# to type-check too:
|
||||
|
||||
/foo/ in strings;
|
||||
print /foo/ in strings;
|
||||
|
||||
# Complex index types need to match, too. (For tests with matching types,
|
||||
# see set.zeek / table.zeek.)
|
||||
|
@ -43,5 +43,5 @@ local table_set: set[table[string] of string] = set();
|
|||
local stringvec_set: set[vector of string] = set();
|
||||
local string_count_map: table[string] of count = table();
|
||||
|
||||
string_count_map in table_set;
|
||||
vector(1, 2, 3) in stringvec_set;
|
||||
print string_count_map in table_set;
|
||||
print vector(1, 2, 3) in stringvec_set;
|
||||
|
|
|
@ -35,7 +35,7 @@ global matched_software: table[string] of Software::Description = {
|
|||
["curl/7.15.1 (i486-pc-linux-gnu) libcurl/7.15.1 OpenSSL/0.9.8a zlib/1.2.3 libidn/0.5.18"] =
|
||||
[$name="curl", $version=[$major=7,$minor=15,$minor2=1,$addl="i486-pc-linux-gnu"], $unparsed_version=""],
|
||||
["Apache"] =
|
||||
[$name="Apache", $unparsed_version=""],
|
||||
[$name="Apache", $version=[], $unparsed_version=""],
|
||||
["Zope/(Zope 2.7.8-final, python 2.3.5, darwin) ZServer/1.1 Plone/Unknown"] =
|
||||
[$name="Zope/(Zope", $version=[$major=2,$minor=7,$minor2=8,$addl="final"], $unparsed_version=""],
|
||||
["The Bat! (v2.00.9) Personal"] =
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue