From 0a536e6ce00b183b4169fbbdcf22a206bd8f6517 Mon Sep 17 00:00:00 2001 From: Ramana Reddy <90540245+RamanaReddy0M@users.noreply.github.com> Date: Thu, 19 Sep 2024 18:52:49 +0530 Subject: [PATCH] fix matcher-status tests (#5647) --- cmd/integration-test/matcher-status.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cmd/integration-test/matcher-status.go b/cmd/integration-test/matcher-status.go index b88763720a..d89f7c46b0 100644 --- a/cmd/integration-test/matcher-status.go +++ b/cmd/integration-test/matcher-status.go @@ -3,6 +3,7 @@ package main import ( "encoding/json" "fmt" + "strings" "github.com/projectdiscovery/nuclei/v3/pkg/output" "github.com/projectdiscovery/nuclei/v3/pkg/testutils" @@ -26,9 +27,9 @@ func (h *httpNoAccess) Execute(filePath string) error { } event := &output.ResultEvent{} _ = json.Unmarshal([]byte(results[0]), event) - - if event.Error != "no address found for host" { - return fmt.Errorf("unexpected result: expecting \"no address found for host\" error but got none") + expectedError := "no address found for host" + if !strings.Contains(event.Error, expectedError) { + return fmt.Errorf("unexpected result: expecting \"%s\" error but got \"%s\"", expectedError, event.Error) } return nil }