mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-17 22:05:27 +00:00
* extend headless contextargs * using darwin-latest * grouping page options * temp commenting code out * fixing test * adding more checks * more checks * fixing first navigation metadata * adding integration test * proto update --------- Co-authored-by: sandeep <8293321+ehsandeep@users.noreply.github.com>
23 lines
626 B
Go
23 lines
626 B
Go
package fuzz
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/projectdiscovery/nuclei/v2/pkg/protocols/common/contextargs"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestRuleIsExecutable(t *testing.T) {
|
|
rule := &Rule{Part: "query"}
|
|
err := rule.Compile(nil, nil)
|
|
require.NoError(t, err, "could not compile rule")
|
|
|
|
input := contextargs.NewWithInput("https://example.com/?url=localhost")
|
|
result := rule.isExecutable(input)
|
|
require.True(t, result, "could not get correct result")
|
|
|
|
input = contextargs.NewWithInput("https://example.com/")
|
|
result = rule.isExecutable(input)
|
|
require.False(t, result, "could not get correct result")
|
|
}
|