mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-02-18 00:17:39 +01:00
Add tests for AI intelligence, Docker/K8s agents, log redaction, and general router helper functions.
19 lines
510 B
Go
19 lines
510 B
Go
package api
|
|
|
|
import "testing"
|
|
|
|
func TestSafePrefixForLog(t *testing.T) {
|
|
if got := safePrefixForLog("value", 0); got != "" {
|
|
t.Fatalf("expected empty for n<=0, got %q", got)
|
|
}
|
|
if got := safePrefixForLog("", 3); got != "" {
|
|
t.Fatalf("expected empty for empty value, got %q", got)
|
|
}
|
|
if got := safePrefixForLog("abc", 3); got != "abc" {
|
|
t.Fatalf("expected full value when len<=n, got %q", got)
|
|
}
|
|
if got := safePrefixForLog("abcdef", 3); got != "abc" {
|
|
t.Fatalf("expected prefix, got %q", got)
|
|
}
|
|
}
|