mirror of
https://github.com/zeek/zeek.git
synced 2025-10-17 05:58:20 +00:00
Merge branch 'topic/AbdelSaTd/case-insensitive-find'
* topic/AbdelSaTd/case-insensitive-find: testing-do-find-str_case-insensitive case-insensitive-search-features-for-do_find_str I did a few small style-fixes while merging this and expanded the test a bit. I also removed unecessary commits. Closes GH-1828
This commit is contained in:
commit
d451fb8184
6 changed files with 78 additions and 8 deletions
17
testing/btest/Baseline/bifs.do_find_str/out
Normal file
17
testing/btest/Baseline/bifs.do_find_str/out
Normal file
|
@ -0,0 +1,17 @@
|
|||
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
|
||||
insensitive
|
||||
48
|
||||
48
|
||||
48
|
||||
-1
|
||||
-1
|
||||
48
|
||||
48
|
||||
sensitive
|
||||
-1
|
||||
-1
|
||||
-1
|
||||
-1
|
||||
-1
|
||||
-1
|
||||
48
|
33
testing/btest/bifs/do_find_str.zeek
Normal file
33
testing/btest/bifs/do_find_str.zeek
Normal file
|
@ -0,0 +1,33 @@
|
|||
#
|
||||
# @TEST-EXEC: zeek -b %INPUT >out
|
||||
# @TEST-EXEC: btest-diff out
|
||||
|
||||
event zeek_init()
|
||||
{
|
||||
local a = "this is the concatenation of HTTP fields of the fOrM of the website that I am protecting";
|
||||
local b = "form";
|
||||
local c = "FORM";
|
||||
local d = "FoRm";
|
||||
local e = "om0";
|
||||
local f = "f0rm";
|
||||
local g = "fOrm";
|
||||
local h = "fOrM";
|
||||
|
||||
|
||||
print "insensitive";
|
||||
print find_str(a, b, 0, -1, F);
|
||||
print find_str(a, c, 0, -1, F);
|
||||
print find_str(a, d, 0, -1, F);
|
||||
print find_str(a, e, 0, -1, F);
|
||||
print find_str(a, f, 0, -1, F);
|
||||
print find_str(a, g, 0, -1, F);
|
||||
print find_str(a, h, 0, -1, F);
|
||||
print "sensitive";
|
||||
print find_str(a, b, 0, -1);
|
||||
print find_str(a, c, 0, -1);
|
||||
print find_str(a, d, 0, -1);
|
||||
print find_str(a, e, 0, -1);
|
||||
print find_str(a, f, 0, -1);
|
||||
print find_str(a, g, 0, -1);
|
||||
print find_str(a, h, 0, -1);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue