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

Function TestScanResult_Methods

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

Source from the content-addressed store, hash-verified

429}
430
431func TestScanResult_Methods(t *testing.T) {
432 result := &ScanResult{
433 Findings: []Finding{{Severity: SeverityCritical}},
434 TotalCount: 1,
435 CriticalCount: 1,
436 }
437
438 if !result.HasCritical() {
439 t.Error("HasCritical should return true")
440 }
441 if !result.HasHighOrAbove() {
442 t.Error("HasHighOrAbove should return true")
443 }
444 if result.IsClean() {
445 t.Error("IsClean should return false")
446 }
447
448 cleanResult := &ScanResult{TotalCount: 0}
449 if !cleanResult.IsClean() {
450 t.Error("IsClean should return true for empty result")
451 }
452}
453
454func TestScan_HavingClause(t *testing.T) {
455 scanner := NewScanner()

Callers

nothing calls this directly

Calls 4

HasCriticalMethod · 0.95
HasHighOrAboveMethod · 0.95
IsCleanMethod · 0.95
ErrorMethod · 0.45

Tested by

no test coverage detected