diff --git a/core/condition_test.go b/core/condition_test.go
index 53275af8..3b18240b 100644
--- a/core/condition_test.go
+++ b/core/condition_test.go
@@ -394,6 +394,20 @@ func TestCondition_evaluateWithBodyStringPattern(t *testing.T) {
}
}
+func TestCondition_evaluateWithBodyHTMLPattern(t *testing.T) {
+ var html = `
john.doe
`
+ condition := Condition("[BODY] == pat(*john.doe
*)")
+ result := &Result{Body: []byte(html)}
+ condition.evaluate(result)
+ if !result.ConditionResults[0].Success {
+ t.Errorf("Condition '%s' should have been a success", condition)
+ }
+ expectedConditionDisplayed := "[BODY] == pat(*john.doe
*)"
+ if result.ConditionResults[0].Condition != expectedConditionDisplayed {
+ t.Errorf("Condition '%s' should have resolved to '%s', got '%s'", condition, expectedConditionDisplayed, result.ConditionResults[0].Condition)
+ }
+}
+
func TestCondition_evaluateWithBodyStringPatternFailure(t *testing.T) {
condition := Condition("[BODY].name == pat(bob*)")
result := &Result{Body: []byte("{\"name\": \"john.doe\"}")}