MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / TestShouldInclude_UnknownSeverity

Function TestShouldInclude_UnknownSeverity

pkg/sql/security/scanner_test.go:649–665  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

647}
648
649func TestShouldInclude_UnknownSeverity(t *testing.T) {
650 scanner := NewScanner()
651
652 // Unknown severity should always be included (fail-safe)
653 if !scanner.shouldInclude(Severity("UNKNOWN")) {
654 t.Error("unknown severity should be included (fail-safe behavior)")
655 }
656
657 // Valid severities should still work correctly
658 scanner.MinSeverity = SeverityHigh
659 if scanner.shouldInclude(SeverityLow) {
660 t.Error("LOW should not be included when MinSeverity is HIGH")
661 }
662 if !scanner.shouldInclude(SeverityCritical) {
663 t.Error("CRITICAL should be included when MinSeverity is HIGH")
664 }
665}
666
667// Test UNION-based injection detection (Issue #170)
668func TestScanSQL_UnionInjection(t *testing.T) {

Callers

nothing calls this directly

Calls 4

shouldIncludeMethod · 0.95
NewScannerFunction · 0.85
SeverityTypeAlias · 0.70
ErrorMethod · 0.45

Tested by

no test coverage detected