mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-28 20:24:22 +01:00
28 lines
431 B
Go
28 lines
431 B
Go
package report
|
|
|
|
import "testing"
|
|
|
|
func TestRedact(t *testing.T) {
|
|
tests := []struct {
|
|
findings []Finding
|
|
redact bool
|
|
}{
|
|
{
|
|
redact: true,
|
|
findings: []Finding{
|
|
{
|
|
Secret: "line containing secret",
|
|
Context: "secret",
|
|
},
|
|
}},
|
|
}
|
|
for _, test := range tests {
|
|
for _, f := range test.findings {
|
|
f.Redact()
|
|
if f.Secret != "REDACT" {
|
|
t.Error("redact not redacting: ", f.Secret)
|
|
}
|
|
}
|
|
}
|
|
}
|