- Add LEGAL.md at repo root (109 lines) covering CFAA, Computer Misuse Act, EU Directive 2013/40/EU, responsible use, disclosure, and disclaimer. - Mirror to pkg/legal/LEGAL.md for go:embed (Go cannot traverse parents). - Add pkg/legal package exposing Text() for the embedded markdown. - Add cmd/legal.go registering keyhunter legal subcommand to print it.
23 lines
441 B
Go
23 lines
441 B
Go
package legal
|
|
|
|
import (
|
|
"strings"
|
|
"testing"
|
|
)
|
|
|
|
func TestText_NonEmpty(t *testing.T) {
|
|
got := Text()
|
|
if len(got) < 500 {
|
|
t.Fatalf("Text() too short: got %d bytes, want > 500", len(got))
|
|
}
|
|
}
|
|
|
|
func TestText_ContainsKeyPhrases(t *testing.T) {
|
|
got := Text()
|
|
for _, phrase := range []string{"CFAA", "Responsible Use", "Disclaimer"} {
|
|
if !strings.Contains(got, phrase) {
|
|
t.Errorf("Text() missing required phrase %q", phrase)
|
|
}
|
|
}
|
|
}
|