zeek/testing/btest/language/record-extension.bro
Jon Siwek 560685f1c6 Fix redef'ing records with &default empty set fields.
Attributes have state to track whether they're in a record and should
apply to a record field, but this state wasn't being set for TypeDecls
that are part of a redef'd record.

Closes #460
2011-08-12 23:24:49 -07:00

21 lines
392 B
Text

# @TEST-EXEC: bro %INPUT >output
# @TEST-EXEC: btest-diff output
type Foo: record {
a: count;
b: count &optional;
myset: set[count] &default=set();
};
redef record Foo += {
c: count &default=42;
d: count &optional;
anotherset: set[count] &default=set();
};
global f1: Foo = [$a=21];
global f2: Foo = [$a=21, $d="XXX"];
print f1;
print f2;