package tests

import "github.com/DefangLabs/secret-detector/pkg/detectors/tests"

Index

Functions

func AssertKeysDetected

func AssertKeysDetected(t *testing.T, expectedKeys []string, expectedType string, detectedSecrets []secrets.DetectedSecret)

func TestScan

func TestScan(t *testing.T, detector secrets.Detector, testCases []TestCase)

func TestScanMap

func TestScanMap(t *testing.T, detector secrets.Detector, testCases []TestCase)

func TestScanWithKey

func TestScanWithKey(t *testing.T, detector secrets.Detector, testCases []TestCase)

func TestScanWithMultipleMatches

func TestScanWithMultipleMatches(t *testing.T, detector secrets.Detector, testCases []TestCase)

func TestScanWithMultipleMatchesWithKey

func TestScanWithMultipleMatchesWithKey(t *testing.T, detector secrets.Detector, testCases []TestCase)

func TestScanWithMultipleMatchesWithoutKey

func TestScanWithMultipleMatchesWithoutKey(t *testing.T, detector secrets.Detector, testCases []TestCase)

Types

type TestCase

type TestCase struct {
	Name, Input     string
	ExpectDetection bool
}

Source Files

helpers.go

Version
v0.0.0-20250403165618-22662109213e (latest)
Published
Apr 3, 2025
Platform
linux/amd64
Imports
4 packages
Last checked
3 weeks ago

Tools for package owners.