mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-30 19:47:47 +03:00
Add/update more unit tests.
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
name => "beginsWith",
|
name => "beginsWith",
|
||||||
param => "",
|
param => "",
|
||||||
input => "",
|
input => "",
|
||||||
ret => 0,
|
ret => 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type => "op",
|
type => "op",
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
name => "beginsWith",
|
name => "beginsWith",
|
||||||
param => "",
|
param => "",
|
||||||
input => "TestCase",
|
input => "TestCase",
|
||||||
ret => 0,
|
ret => 1,
|
||||||
},
|
},
|
||||||
|
|
||||||
### General
|
### General
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
name => "endsWith",
|
name => "endsWith",
|
||||||
param => "",
|
param => "",
|
||||||
input => "",
|
input => "",
|
||||||
ret => 0,
|
ret => 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type => "op",
|
type => "op",
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
name => "endsWith",
|
name => "endsWith",
|
||||||
param => "",
|
param => "",
|
||||||
input => "TestCase",
|
input => "TestCase",
|
||||||
ret => 0,
|
ret => 1,
|
||||||
},
|
},
|
||||||
|
|
||||||
### General
|
### General
|
||||||
|
@@ -1 +1,62 @@
|
|||||||
|
### Empty
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "rx",
|
||||||
|
param => "",
|
||||||
|
input => "",
|
||||||
|
ret => 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "rx",
|
||||||
|
param => "TestCase",
|
||||||
|
input => "",
|
||||||
|
ret => 0,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "rx",
|
||||||
|
param => "",
|
||||||
|
input => "TestCase",
|
||||||
|
ret => 1,
|
||||||
|
},
|
||||||
|
|
||||||
|
### General
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "rx",
|
||||||
|
param => "abc",
|
||||||
|
input => "abcdefghi",
|
||||||
|
ret => 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "rx",
|
||||||
|
param => "def",
|
||||||
|
input => "abcdefghi",
|
||||||
|
ret => 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "rx",
|
||||||
|
param => "ghi",
|
||||||
|
input => "abcdefghi",
|
||||||
|
ret => 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "rx",
|
||||||
|
param => "ghij",
|
||||||
|
input => "abcdefghi",
|
||||||
|
ret => 0,
|
||||||
|
},
|
||||||
|
|
||||||
|
### Complex regex
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "rx",
|
||||||
|
param => qr/^([^=])\s*=\s*((?:abc)+(?:def|ghi){2})$/i,
|
||||||
|
input => "x =AbCDeFgHi",
|
||||||
|
ret => 1,
|
||||||
|
},
|
||||||
|
|
||||||
|
@@ -1 +1,52 @@
|
|||||||
|
### Empty
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "streq",
|
||||||
|
param => "",
|
||||||
|
input => "",
|
||||||
|
ret => 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "streq",
|
||||||
|
param => "TestCase",
|
||||||
|
input => "",
|
||||||
|
ret => 0,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "streq",
|
||||||
|
param => "",
|
||||||
|
input => "TestCase",
|
||||||
|
ret => 0,
|
||||||
|
},
|
||||||
|
|
||||||
|
### General
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "streq",
|
||||||
|
param => "abc",
|
||||||
|
input => "abcdefghi",
|
||||||
|
ret => 0,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "streq",
|
||||||
|
param => "def",
|
||||||
|
input => "abcdefghi",
|
||||||
|
ret => 0,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "streq",
|
||||||
|
param => "ghi",
|
||||||
|
input => "abcdefghi",
|
||||||
|
ret => 0,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "streq",
|
||||||
|
param => "abcdefghi",
|
||||||
|
input => "abcdefghi",
|
||||||
|
ret => 1,
|
||||||
|
},
|
||||||
|
@@ -1 +1,23 @@
|
|||||||
|
### Empty
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "unconditionalMatch",
|
||||||
|
param => "",
|
||||||
|
input => "",
|
||||||
|
ret => 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "unconditionalMatch",
|
||||||
|
param => "TestCase",
|
||||||
|
input => "",
|
||||||
|
ret => 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "unconditionalMatch",
|
||||||
|
param => "",
|
||||||
|
input => "TestCase",
|
||||||
|
ret => 1,
|
||||||
|
},
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user