zeek/testing/btest/doc/zeekygen/enums.zeek
Jon Siwek 6ad7099f7e Merge remote-tracking branch 'origin/topic/robin/gh-239'
* origin/topic/robin/gh-239:
  Undo a change to btest.cfg from a recent commit
  Updating submodule.
  Fix zeek-wrapper
  Update for renaming BroControl to ZeekControl.
  Updating submodule.
  GH-239: Rename bro to zeek, bro-config to zeek-config, and bro-path-dev to zeek-path-dev.
2019-05-14 13:27:40 -07:00

43 lines
909 B
Text

# @TEST-EXEC: unset BRO_DISABLE_BROXYGEN; zeek -b -X zeekygen.config %INPUT
# @TEST-EXEC: btest-diff autogen-reST-enums.rst
@TEST-START-FILE zeekygen.config
identifier TestEnum* autogen-reST-enums.rst
@TEST-END-FILE
## There's tons of ways an enum can look...
type TestEnum1: enum {
## like this
ONE,
TWO, ##< or like this
## multiple
## comments
THREE, ##< and even
##< more comments
};
## The final comma is optional
type TestEnum2: enum {
## like this
A,
B, ##< or like this
## multiple
## comments
C ##< and even
##< more comments
};
## redefs should also work
redef enum TestEnum1 += {
## adding another
FOUR ##< value
};
## now with a comma
redef enum TestEnum1 += {
## adding another
FIVE, ##< value
};
## this should reference the TestEnum1 type and not a generic "enum" type
const TestEnumVal = ONE &redef;