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:
Robin Sommer 2011-02-07 16:10:09 -08:00
parent 95069f0993
commit 2f30c3d245
3 changed files with 47 additions and 0 deletions

17
testing/rec.bro Normal file
View 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
View 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
View 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;
};