Skip to content

Commit

Permalink
Add 3 new test cases for comparison operators to handle more edge cas…
Browse files Browse the repository at this point in the history
…es + add test force rule - coverage with integer hash attribute
  • Loading branch information
vazarkevych committed Nov 6, 2023
1 parent a8a3b32 commit c6cf771
Showing 1 changed file with 66 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,46 @@ val gbTestCases = """
},
false
],
[
"missing attribute with comparison operators",
{
"age": {
"${"$"}gt": -10,
"${"$"}lt": 10,
"${"$"}gte": -9,
"${"$"}lte": 9,
"${"$"}ne": 10
}
},
{},
false
],
[
"comparing numbers and strings",
{
"n": {
"${"$"}gt": 5,
"${"$"}lt": 10
}
},
{
"n": "8"
},
true
],
[
"comparing numbers and strings - v2",
{
"n": {
"${"$"}gt": "5",
"${"$"}lt": "10"
}
},
{
"n": 8
},
true
],
[
"empty ${"$"}or - pass",
{
Expand Down Expand Up @@ -2087,6 +2127,32 @@ val gbTestCases = """
"source": "force"
}
],
[
"force rule - coverage with integer hash attribute",
{
"attributes": {
"id": 3
},
"features": {
"feature": {
"defaultValue": 2,
"rules": [
{
"force": 1,
"coverage": 0.5
}
]
}
}
},
"feature",
{
"value": 1,
"on": true,
"off": false,
"source": "force"
}
],
[
"force rules - coverage excluded",
{
Expand Down

0 comments on commit c6cf771

Please sign in to comment.