zeek/testing/btest/language/identifier-not-defined-error.zeek
Arne Welzel 25ee288a76 Tame error reporting and abort() for undefined types
The script added as a test case reports the following messages *and*
dumps a core file. Printing the first error and a normal failure exit
seems sufficient. IMO triggering an abort() due to user scripting issues
is not something that Zeek should do

    $ zeek ./identifier-not-defined-error.zeek
    error in ./identifier-not-defined-error.zeek, line 10: identifier not defined: MyEnu
    error in ./identifier-not-defined-error.zeek, line 10 and error: &default value has inconsistent type (M::MY_ENUM_A and error)
    internal error in ./identifier-not-defined-error.zeek, line 11: type inconsistency in ZVal constructor
    Aborted (core dumped)

Change is to skip certain checks when an error type is propagated.
2023-01-26 20:05:02 +01:00

14 lines
266 B
Text

# @TEST-EXEC-FAIL: zeek -b %INPUT >out 2>&1
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff out
module MyModule;
export {
type MyEnum: enum {
MY_ENUM_A,
MY_ENUM_B,
};
type MyRec: record {
a: MyEnumTypo &default=MY_ENUM_A;
};
}