testutil

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package testutil provides shared helpers for detector tests. It exercises the real matcher -> Scan path so tests can prove that a detector's keywords (or lack thereof) actually let the matcher gate select the detector at runtime.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ScanViaMatcher

func ScanViaMatcher(det detector.Detector, data []byte) []detector.RawFinding

ScanViaMatcher runs det through the real Aho-Corasick matcher gate before calling Scan, mirroring the engine pipeline. It returns the findings only if the matcher actually selected det for the given data; if the matcher gates the detector out, an empty slice is returned even when the regex would have matched. This makes keyword/regex misalignment visible in tests.

Types

This section is empty.

Jump to

Keyboard shortcuts

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