mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-16 16:06:12 +03:00
Added unit tests for numeric comparison operators.
This commit is contained in:
parent
50a9f76dde
commit
b579e704ab
@ -1 +1,101 @@
|
|||||||
|
### Empty
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "eq",
|
||||||
|
param => "0",
|
||||||
|
input => "",
|
||||||
|
ret => 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "eq",
|
||||||
|
param => "5",
|
||||||
|
input => "",
|
||||||
|
ret => 0,
|
||||||
|
},
|
||||||
|
|
||||||
|
### Invalid
|
||||||
|
# xxx interpreted as 0
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "eq",
|
||||||
|
param => "xxx",
|
||||||
|
input => "0",
|
||||||
|
ret => 1,
|
||||||
|
},
|
||||||
|
# xxx interpreted as 0
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "eq",
|
||||||
|
param => "xxx",
|
||||||
|
input => "5",
|
||||||
|
ret => 0,
|
||||||
|
},
|
||||||
|
# xxx interpreted as 0
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "eq",
|
||||||
|
param => "xxx",
|
||||||
|
input => "-1",
|
||||||
|
ret => 0,
|
||||||
|
},
|
||||||
|
# xxx interpreted as 0
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "eq",
|
||||||
|
param => "0",
|
||||||
|
input => "xxx",
|
||||||
|
ret => 1,
|
||||||
|
},
|
||||||
|
# xxx interpreted as 0
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "eq",
|
||||||
|
param => "5",
|
||||||
|
input => "xxx",
|
||||||
|
ret => 0,
|
||||||
|
},
|
||||||
|
|
||||||
|
### General
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "eq",
|
||||||
|
param => "0",
|
||||||
|
input => "-5",
|
||||||
|
ret => 0,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "eq",
|
||||||
|
param => "0",
|
||||||
|
input => "0",
|
||||||
|
ret => 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "eq",
|
||||||
|
param => "0",
|
||||||
|
input => "5",
|
||||||
|
ret => 0,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "eq",
|
||||||
|
param => "5",
|
||||||
|
input => "0",
|
||||||
|
ret => 0,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "eq",
|
||||||
|
param => "5",
|
||||||
|
input => "5",
|
||||||
|
ret => 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "eq",
|
||||||
|
param => "5",
|
||||||
|
input => "10",
|
||||||
|
ret => 0,
|
||||||
|
},
|
||||||
|
@ -1 +1,93 @@
|
|||||||
|
### Empty
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "ge",
|
||||||
|
param => "0",
|
||||||
|
input => "",
|
||||||
|
ret => 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "ge",
|
||||||
|
param => "5",
|
||||||
|
input => "",
|
||||||
|
ret => 0,
|
||||||
|
},
|
||||||
|
|
||||||
|
### Invalid
|
||||||
|
# xxx interpreted as 0
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "ge",
|
||||||
|
param => "xxx",
|
||||||
|
input => "5",
|
||||||
|
ret => 1,
|
||||||
|
},
|
||||||
|
# xxx interpreted as 0
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "ge",
|
||||||
|
param => "xxx",
|
||||||
|
input => "-1",
|
||||||
|
ret => 0,
|
||||||
|
},
|
||||||
|
# xxx interpreted as 0
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "ge",
|
||||||
|
param => "0",
|
||||||
|
input => "xxx",
|
||||||
|
ret => 1,
|
||||||
|
},
|
||||||
|
# xxx interpreted as 0
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "ge",
|
||||||
|
param => "5",
|
||||||
|
input => "xxx",
|
||||||
|
ret => 0,
|
||||||
|
},
|
||||||
|
|
||||||
|
### General
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "ge",
|
||||||
|
param => "0",
|
||||||
|
input => "-5",
|
||||||
|
ret => 0,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "ge",
|
||||||
|
param => "0",
|
||||||
|
input => "0",
|
||||||
|
ret => 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "ge",
|
||||||
|
param => "0",
|
||||||
|
input => "5",
|
||||||
|
ret => 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "ge",
|
||||||
|
param => "5",
|
||||||
|
input => "0",
|
||||||
|
ret => 0,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "ge",
|
||||||
|
param => "5",
|
||||||
|
input => "5",
|
||||||
|
ret => 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "ge",
|
||||||
|
param => "5",
|
||||||
|
input => "10",
|
||||||
|
ret => 1,
|
||||||
|
},
|
||||||
|
@ -1 +1,93 @@
|
|||||||
|
### Empty
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "gt",
|
||||||
|
param => "0",
|
||||||
|
input => "",
|
||||||
|
ret => 0,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "gt",
|
||||||
|
param => "5",
|
||||||
|
input => "",
|
||||||
|
ret => 0,
|
||||||
|
},
|
||||||
|
|
||||||
|
### Invalid
|
||||||
|
# xxx interpreted as 0
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "gt",
|
||||||
|
param => "xxx",
|
||||||
|
input => "5",
|
||||||
|
ret => 1,
|
||||||
|
},
|
||||||
|
# xxx interpreted as 0
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "gt",
|
||||||
|
param => "xxx",
|
||||||
|
input => "-1",
|
||||||
|
ret => 0,
|
||||||
|
},
|
||||||
|
# xxx interpreted as 0
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "gt",
|
||||||
|
param => "-1",
|
||||||
|
input => "xxx",
|
||||||
|
ret => 1,
|
||||||
|
},
|
||||||
|
# xxx interpreted as 0
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "gt",
|
||||||
|
param => "5",
|
||||||
|
input => "xxx",
|
||||||
|
ret => 0,
|
||||||
|
},
|
||||||
|
|
||||||
|
### General
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "gt",
|
||||||
|
param => "0",
|
||||||
|
input => "-5",
|
||||||
|
ret => 0,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "gt",
|
||||||
|
param => "0",
|
||||||
|
input => "0",
|
||||||
|
ret => 0,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "gt",
|
||||||
|
param => "0",
|
||||||
|
input => "5",
|
||||||
|
ret => 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "gt",
|
||||||
|
param => "5",
|
||||||
|
input => "0",
|
||||||
|
ret => 0,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "gt",
|
||||||
|
param => "5",
|
||||||
|
input => "5",
|
||||||
|
ret => 0,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "gt",
|
||||||
|
param => "5",
|
||||||
|
input => "10",
|
||||||
|
ret => 1,
|
||||||
|
},
|
||||||
|
@ -1 +1,93 @@
|
|||||||
|
### Empty
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "le",
|
||||||
|
param => "0",
|
||||||
|
input => "",
|
||||||
|
ret => 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "le",
|
||||||
|
param => "5",
|
||||||
|
input => "",
|
||||||
|
ret => 1,
|
||||||
|
},
|
||||||
|
|
||||||
|
### Invalid
|
||||||
|
# xxx interpreted as 0
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "le",
|
||||||
|
param => "xxx",
|
||||||
|
input => "5",
|
||||||
|
ret => 0,
|
||||||
|
},
|
||||||
|
# xxx interpreted as 0
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "le",
|
||||||
|
param => "xxx",
|
||||||
|
input => "-1",
|
||||||
|
ret => 1,
|
||||||
|
},
|
||||||
|
# xxx interpreted as 0
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "le",
|
||||||
|
param => "0",
|
||||||
|
input => "xxx",
|
||||||
|
ret => 1,
|
||||||
|
},
|
||||||
|
# xxx interpreted as 0
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "le",
|
||||||
|
param => "5",
|
||||||
|
input => "xxx",
|
||||||
|
ret => 1,
|
||||||
|
},
|
||||||
|
|
||||||
|
### General
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "le",
|
||||||
|
param => "0",
|
||||||
|
input => "-5",
|
||||||
|
ret => 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "le",
|
||||||
|
param => "0",
|
||||||
|
input => "0",
|
||||||
|
ret => 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "le",
|
||||||
|
param => "0",
|
||||||
|
input => "5",
|
||||||
|
ret => 0,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "le",
|
||||||
|
param => "5",
|
||||||
|
input => "0",
|
||||||
|
ret => 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "le",
|
||||||
|
param => "5",
|
||||||
|
input => "5",
|
||||||
|
ret => 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "le",
|
||||||
|
param => "5",
|
||||||
|
input => "10",
|
||||||
|
ret => 0,
|
||||||
|
},
|
||||||
|
@ -1 +1,93 @@
|
|||||||
|
### Empty
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "lt",
|
||||||
|
param => "0",
|
||||||
|
input => "",
|
||||||
|
ret => 0,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "lt",
|
||||||
|
param => "5",
|
||||||
|
input => "",
|
||||||
|
ret => 1,
|
||||||
|
},
|
||||||
|
|
||||||
|
### Invalid
|
||||||
|
# xxx interpreted as 0
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "lt",
|
||||||
|
param => "xxx",
|
||||||
|
input => "5",
|
||||||
|
ret => 0,
|
||||||
|
},
|
||||||
|
# xxx interpreted as 0
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "lt",
|
||||||
|
param => "xxx",
|
||||||
|
input => "-1",
|
||||||
|
ret => 1,
|
||||||
|
},
|
||||||
|
# xxx interpreted as 0
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "lt",
|
||||||
|
param => "-1",
|
||||||
|
input => "xxx",
|
||||||
|
ret => 0,
|
||||||
|
},
|
||||||
|
# xxx interpreted as 0
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "lt",
|
||||||
|
param => "5",
|
||||||
|
input => "xxx",
|
||||||
|
ret => 1,
|
||||||
|
},
|
||||||
|
|
||||||
|
### General
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "lt",
|
||||||
|
param => "0",
|
||||||
|
input => "-5",
|
||||||
|
ret => 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "lt",
|
||||||
|
param => "0",
|
||||||
|
input => "0",
|
||||||
|
ret => 0,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "lt",
|
||||||
|
param => "0",
|
||||||
|
input => "5",
|
||||||
|
ret => 0,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "lt",
|
||||||
|
param => "5",
|
||||||
|
input => "0",
|
||||||
|
ret => 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "lt",
|
||||||
|
param => "5",
|
||||||
|
input => "5",
|
||||||
|
ret => 0,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type => "op",
|
||||||
|
name => "lt",
|
||||||
|
param => "5",
|
||||||
|
input => "10",
|
||||||
|
ret => 0,
|
||||||
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user