Skip to content

Commit d03f4c1

Browse files
martinhsvzimmerle
authored andcommitted
Add support for new operator rxGlobal (secrule tests)
1 parent c8cf2c5 commit d03f4c1

File tree

1 file changed

+162
-0
lines changed

1 file changed

+162
-0
lines changed

operators/rxGlobal.json

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
[
2+
{
3+
"param" : "test",
4+
"input" : "qqtestqq",
5+
"ret" : 1,
6+
"type" : "op",
7+
"name" : "rxGlobal"
8+
},
9+
{
10+
"param" : "",
11+
"input" : "",
12+
"ret" : 1,
13+
"type" : "op",
14+
"name" : "rxGlobal"
15+
},
16+
{
17+
"name" : "rxGlobal",
18+
"type" : "op",
19+
"ret" : 0,
20+
"param" : "TestCase",
21+
"input" : ""
22+
},
23+
{
24+
"ret" : 1,
25+
"type" : "op",
26+
"name" : "rxGlobal",
27+
"param" : "",
28+
"input" : "TestCase"
29+
},
30+
{
31+
"param" : "abc",
32+
"input" : "abcdefghi",
33+
"type" : "op",
34+
"ret" : 1,
35+
"name" : "rxGlobal"
36+
},
37+
{
38+
"param" : "def",
39+
"input" : "abcdefghi",
40+
"type" : "op",
41+
"ret" : 1,
42+
"name" : "rxGlobal",
43+
"re_groups": ["def"]
44+
},
45+
{
46+
"param" : "ghi",
47+
"input" : "abcdefghi",
48+
"name" : "rxGlobal",
49+
"type" : "op",
50+
"ret" : 1,
51+
"re_groups": ["ghi"]
52+
},
53+
{
54+
"ret" : 0,
55+
"type" : "op",
56+
"name" : "rxGlobal",
57+
"param" : "ghij",
58+
"input" : "abcdefghi"
59+
},
60+
{
61+
"ret" : 1,
62+
"type" : "op",
63+
"name" : "rxGlobal",
64+
"param" : "(?i:(sleep\\((\\s*?)(\\d*?)(\\s*?)\\)|benchmark\\((.*?)\\,(.*?)\\)))",
65+
"input" : "SELECT pg_sleep(10);"
66+
},
67+
{
68+
"type" : "op",
69+
"name" : "rxGlobal",
70+
"param" : "(abc)(def)",
71+
"input" : "abcdef",
72+
"ret" : 1,
73+
"re_groups": ["abcdef", "abc", "def"]
74+
},
75+
{
76+
"type" : "op",
77+
"name" : "rxGlobal",
78+
"param" : "(a|b|1|2)(a|b|1|2)",
79+
"input" : "a2b1",
80+
"ret" : 1,
81+
"re_groups": ["a2", "a", "2"]
82+
},
83+
{
84+
"type" : "op",
85+
"name" : "rxGlobal",
86+
"param" : "<\\?(?!xml)",
87+
"input" : "<?php",
88+
"ret" : 1,
89+
"re_groups": ["<?"]
90+
},
91+
{
92+
"type" : "op",
93+
"name" : "rxGlobal",
94+
"param" : "<\\?(?!xml)",
95+
"input" : "<?xml",
96+
"ret" : 0
97+
},
98+
{
99+
"type" : "op",
100+
"name" : "rxGlobal",
101+
"param" : "abc\ndef",
102+
"input" : "abc\ndef",
103+
"ret" : 1,
104+
"re_groups": ["abc\ndef"]
105+
},
106+
{
107+
"type" : "op",
108+
"name" : "rxGlobal",
109+
"param" : "[a-z]\n",
110+
"input" : "a\nb\nc\n",
111+
"ret" : 1,
112+
"re_groups": ["a\n"]
113+
},
114+
{
115+
"type" : "op",
116+
"name" : "rxGlobal",
117+
"param" : "[a-z]*",
118+
"input" : "abkjgdsgk",
119+
"ret" : 1,
120+
"re_groups": ["abkjgdsgk"]
121+
},
122+
{
123+
"type" : "op",
124+
"name" : "rxGlobal",
125+
"param" : "([a-z]*)",
126+
"input" : "",
127+
"ret" : 1,
128+
"re_groups": ["", ""]
129+
},
130+
{
131+
"type" : "op",
132+
"name" : "rxGlobal",
133+
"param" : "[a-z]*",
134+
"input" : "aaa0bbb",
135+
"ret" : 1,
136+
"re_groups": ["aaa", "bbb"]
137+
},
138+
{
139+
"type" : "op",
140+
"name" : "rxGlobal",
141+
"param" : "[a-z]*",
142+
"input" : "aaa00bbb",
143+
"ret" : 1,
144+
"re_groups": ["aaa", "bbb"]
145+
},
146+
{
147+
"type" : "op",
148+
"name" : "rxGlobal",
149+
"param" : "(a)(b?)(c)",
150+
"input" : "ac",
151+
"ret" : 1,
152+
"re_groups": ["ac", "a", "", "c"]
153+
},
154+
{
155+
"type" : "op",
156+
"name" : "rxGlobal",
157+
"param" : "(^|a)(b|c)(d)",
158+
"input" : "bdacd",
159+
"ret" : 1,
160+
"re_groups": ["bd", "", "b", "d", "acd", "a", "c", "d"]
161+
}
162+
]

0 commit comments

Comments
 (0)