mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Adding some tests for the record-extension feature.
These will go somewhere else eventually, just making sure they don't get lost.
This commit is contained in:
parent
95069f0993
commit
2f30c3d245
3 changed files with 47 additions and 0 deletions
17
testing/rec.bro
Normal file
17
testing/rec.bro
Normal file
|
@ -0,0 +1,17 @@
|
|||
# @TEST-EXEC: bro %INPUT >output
|
||||
# @TEST-EXEC: btest-diff output
|
||||
|
||||
type Foo: record {
|
||||
a: count;
|
||||
b: count &optional;
|
||||
};
|
||||
|
||||
redef record Foo += {
|
||||
c: count &default=42;
|
||||
d: count &optional;
|
||||
};
|
||||
|
||||
global f: Foo = [$a=21];
|
||||
|
||||
print f;
|
||||
|
17
testing/rec2.bro
Normal file
17
testing/rec2.bro
Normal file
|
@ -0,0 +1,17 @@
|
|||
# @TEST-EXEC: bro %INPUT >output
|
||||
# @TEST-EXEC: btest-diff output
|
||||
|
||||
type Foo: record {
|
||||
a: count;
|
||||
b: count &optional;
|
||||
};
|
||||
|
||||
redef record Foo += {
|
||||
c: count &default=42;
|
||||
d: string &optional;
|
||||
};
|
||||
|
||||
global f: Foo = [$a=21, $d="XXX"];
|
||||
|
||||
print f;
|
||||
|
13
testing/wrong-rec.bro
Normal file
13
testing/wrong-rec.bro
Normal file
|
@ -0,0 +1,13 @@
|
|||
# @TEST-EXEC-FAIL: bro %INPUT >output 2>&1
|
||||
# @TEST-EXEC: btest-diff output
|
||||
|
||||
type Foo: record {
|
||||
a: count;
|
||||
b: count &optional;
|
||||
};
|
||||
|
||||
redef record Foo += {
|
||||
c: count;
|
||||
d: string &optional;
|
||||
};
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue