mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-28 12:14:22 +01:00
* working on deduping * my eyes... oh god my poor eyes * more readme * more readme * more readme * more readme and formatting
28 lines
429 B
Go
28 lines
429 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",
|
|
Match: "secret",
|
|
},
|
|
}},
|
|
}
|
|
for _, test := range tests {
|
|
for _, f := range test.findings {
|
|
f.Redact()
|
|
if f.Secret != "REDACT" {
|
|
t.Error("redact not redacting: ", f.Secret)
|
|
}
|
|
}
|
|
}
|
|
}
|