zeek/testing/btest/language/enum-name-conflict.zeek
Jon Siwek 13f3cb377f GH-1534: Fix excessive coredump for duplicate enum definitions
An adequate error message was previously reported for duplicate enum
definitions, this just now prevents trying to access it as a constant in
subsequent parsing and further generating a coredump.
2021-04-29 15:20:09 -07:00

49 lines
529 B
Text

# @TEST-EXEC-FAIL: zeek -b %INPUT >output 2>&1
# @TEST-EXEC: TEST_DIFF_CANONIFIER="$SCRIPTS/diff-remove-abspath" btest-diff output
type a: enum {
RED,
BLUE
};
type b: enum {
BLUE,
GREEN
};
redef enum b += {
RED,
};
module Foo;
export {
type af: enum {
ONE,
TWO
};
type bf: enum {
TWO,
THREE
};
redef enum bf += {
ONE,
};
}
module GLOBAL;
global NOPE = 37;
redef enum a += {
NOPE,
};
type E: enum { Red, Green, Blue };
redef enum E += { Pink };
redef enum E += { Pink };
print Pink;
print Pink;