utils

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckLine

func CheckLine(t *testing.T, expec, want string, line int)

CheckLine executes assertions to validate the content of two JSON files

func DevPathAdapter

func DevPathAdapter(path string) string

DevPathAdapter adapts the path to enable local scanner execution

func FileCheck

func FileCheck(t *testing.T, actualPayloadName, expectPayloadName, location string)

FileCheck executes assertions to validate file content length

func GetScannerLocalBin

func GetScannerLocalBin() string

GetScannerLocalBin returns the scanner local bin path

func JSONSchemaCompare

func JSONSchemaCompare(t *testing.T, schema, report gojsonschema.JSONLoader)

JSONSchemaCompare executes schema assertions to validate the content of a JSON file

func JSONSchemaValidationFromFile

func JSONSchemaValidationFromFile(t *testing.T, file, schema string)

JSONSchemaValidationFromFile loads a json file and validates it against a schema

func PrepareExpected

func PrepareExpected(path, folder string) ([]string, error)

PrepareExpected prepares the files for validation tests

func ReadFixture

func ReadFixture(testName, folder string) (string, error)

ReadFixture reads a file based on a provided path and filename

Types

type CmdOutput

type CmdOutput struct {
	Output []string
	Status int
}

CmdOutput stores the structure of the scanner output

func RunCommand

func RunCommand(scannerArgs []string) (*CmdOutput, error)

RunCommand executes the scanner in a terminal

Jump to

Keyboard shortcuts

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