testutil

package
v1.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 1, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package testutil provides testing utilities and mock implementations for the PI scanner. It includes mock detectors, test data generators, and helper functions for writing comprehensive tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockContextDetector

type MockContextDetector struct {
	// contains filtered or unexported fields
}

MockContextDetector wraps a base detector and applies simple context filtering

func NewMockContextDetector

func NewMockContextDetector(base detection.Detector) *MockContextDetector

NewMockContextDetector creates a detector that filters out obvious false positives

func (*MockContextDetector) Detect

func (mcd *MockContextDetector) Detect(ctx context.Context, content []byte, filename string) ([]detection.Finding, error)

Detect runs the base detector and then filters results based on context

func (*MockContextDetector) Name

func (mcd *MockContextDetector) Name() string

Name returns the detector name

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL