Skip to content

Commit

Permalink
fix matcher-status tests (projectdiscovery#5647)
Browse files Browse the repository at this point in the history
  • Loading branch information
RamanaReddy0M authored Sep 19, 2024
1 parent c8cc419 commit 0a536e6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cmd/integration-test/matcher-status.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
}
Expand Down

0 comments on commit 0a536e6

Please sign in to comment.