Files
sub2api/backend/internal/handler/ops_error_logger_attribution_test.go
T

15 lines
304 B
Go
Raw Normal View History

package handler
import (
"testing"
)
func TestKeyPrefix(t *testing.T) {
if got := keyPrefix("sk-3f2a9c7e", 8); got != "sk-3f2a9" {
t.Errorf("keyPrefix=%q want %q", got, "sk-3f2a9")
}
if got := keyPrefix("abc", 8); got != "abc" {
t.Errorf("short key should be returned as-is, got %q", got)
}
}