mirror of
https://github.com/zeek/zeek.git
synced 2025-10-08 01:28:20 +00:00
Reformat badly formatted btest
This commit is contained in:
parent
06061a3579
commit
7a6f7baf4a
1 changed files with 145 additions and 144 deletions
|
@ -7,11 +7,10 @@ function test_case(msg: string, expect: bool)
|
|||
print fmt("%s (%s)", msg, expect ? "PASS" : "FAIL");
|
||||
}
|
||||
|
||||
|
||||
# Note: only global sets can be initialized with curly braces
|
||||
global sg1: set[string] = { "curly", "braces" };
|
||||
global sg2: set[port, string, bool] = { [10/udp, "curly", F],
|
||||
[11/udp, "braces", T] };
|
||||
global sg2: set[port, string, bool] = { [ 10/udp, "curly", F ], [ 11/udp,
|
||||
"braces", T ] };
|
||||
global sg3 = { "more", "curly", "braces" };
|
||||
|
||||
function basic_functionality()
|
||||
|
@ -20,8 +19,8 @@ function basic_functionality()
|
|||
local s2: set[string] = set();
|
||||
local s3: set[string];
|
||||
local s4 = set("type inference");
|
||||
local s5: set[port, string, bool] = set( [1/tcp, "test", T],
|
||||
[2/tcp, "example", F] );
|
||||
local s5: set[port, string, bool] = set([ 1/tcp, "test", T ], [ 2/tcp,
|
||||
"example", F ]);
|
||||
local s6: set[port, string, bool] = set();
|
||||
local s7: set[port, string, bool];
|
||||
local s8 = set([ 8/tcp, "type inference", T ]);
|
||||
|
@ -138,7 +137,6 @@ function basic_functionality()
|
|||
test_case("remove element", |sg3| == 3);
|
||||
test_case("!in operator", "curly" !in sg3);
|
||||
|
||||
|
||||
local a = set(1, 5, 7, 9, 8, 14);
|
||||
local b = set(1, 7, 9, 2);
|
||||
|
||||
|
@ -208,7 +206,8 @@ function complex_index_type_table()
|
|||
# Iteration
|
||||
for ( ti in s )
|
||||
{
|
||||
test_case( "table index iteration", to_json(ti) == to_json(table(["k2"] = "v2")) );
|
||||
test_case("table index iteration", to_json(ti) == to_json(table([ "k2" ] =
|
||||
"v2")));
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -235,7 +234,8 @@ function complex_index_type_vector()
|
|||
|
||||
for ( vi in s )
|
||||
{
|
||||
test_case( "vector index iteration", to_json(vi) == to_json(vector("v3", "v4")) );
|
||||
test_case("vector index iteration", to_json(vi) == to_json(vector("v3",
|
||||
"v4")));
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -291,7 +291,8 @@ function complex_index_type_pattern()
|
|||
|
||||
local fjr = from_json(to_json(s), p_set);
|
||||
test_case("pattern index JSON roundtrip success", fjr$valid);
|
||||
test_case( "pattern index JSON roundtrip correct", to_json(s) == to_json(fjr$v) );
|
||||
test_case("pattern index JSON roundtrip correct", to_json(s) == to_json(
|
||||
fjr$v));
|
||||
}
|
||||
|
||||
# Issue 3933: Sets defined with an empty container and {[]} were silently discarding
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue