mirror of
https://github.com/TwiN/gatus.git
synced 2025-01-22 13:58:58 +01:00
test: Add case for making sure pat() works inside a JSON array
This commit is contained in:
parent
cdbf5902c7
commit
502e159dca
@ -309,6 +309,13 @@ func TestCondition_evaluate(t *testing.T) {
|
|||||||
ExpectedSuccess: false,
|
ExpectedSuccess: false,
|
||||||
ExpectedOutput: "pat(*<div id=\"user\">john.doe</div>*) == [BODY] (<!DOCTYPE html><html lang...(truncated))",
|
ExpectedOutput: "pat(*<div id=\"user\">john.doe</div>*) == [BODY] (<!DOCTYPE html><html lang...(truncated))",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Name: "body-pattern-in-array",
|
||||||
|
Condition: Condition("[BODY].data == pat(*Whatever*)"),
|
||||||
|
Result: &Result{body: []byte("{\"data\": [\"hello\", \"world\", \"Whatever\"]}")},
|
||||||
|
ExpectedSuccess: true,
|
||||||
|
ExpectedOutput: "[BODY].data == pat(*Whatever*)",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
Name: "ip-pattern",
|
Name: "ip-pattern",
|
||||||
Condition: Condition("[IP] == pat(10.*)"),
|
Condition: Condition("[IP] == pat(10.*)"),
|
||||||
|
Loading…
Reference in New Issue
Block a user