mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
GH-1497: Support CRLF line-endings in Zeek scripts and signature files
This commit is contained in:
parent
4ae056b1a3
commit
312547ab0a
6 changed files with 55 additions and 12 deletions
35
testing/btest/language/crlf-parsing.zeek
Normal file
35
testing/btest/language/crlf-parsing.zeek
Normal file
|
@ -0,0 +1,35 @@
|
|||
# @TEST-EXEC: zeek -b %INPUT >out
|
||||
# @TEST-EXEC: btest-diff out
|
||||
# @TEST-DOC: Checks that CRLF line endings work in zeek/signature files
|
||||
# Note the test file itself uses CRLFs and .gitattributes has an entry
|
||||
# to ensure preservation of the CRLFs.
|
||||
|
||||
@TEST-START-FILE test.sig
|
||||
signature blah
|
||||
{
|
||||
ip-proto == tcp
|
||||
src-port == 21
|
||||
payload /.*/
|
||||
event "matched"
|
||||
}
|
||||
@TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE test.zeek
|
||||
event zeek_init()
|
||||
{
|
||||
print "zeek_init";
|
||||
}
|
||||
@TEST-END-FILE
|
||||
|
||||
@load test.zeek
|
||||
@load-sigs test.sig
|
||||
|
||||
print "first hello";
|
||||
|
||||
@if ( T )
|
||||
print "hello T";
|
||||
@else
|
||||
print "hello F";
|
||||
@endif
|
||||
|
||||
print "last hello";
|
Loading…
Add table
Add a link
Reference in a new issue