| 1234567891011121314151617181920 |
- package mask
- import "testing"
- func TestValue(t *testing.T) {
- cases := []struct {
- in, want string
- }{
- {"", "***"},
- {"a", "***"},
- {"abcd", "***"},
- {"abcde", "abcd***"},
- {"sk-ant-xxxxxxxxx", "sk-a***"},
- }
- for _, c := range cases {
- if got := Value(c.in); got != c.want {
- t.Errorf("Value(%q) = %q want %q", c.in, got, c.want)
- }
- }
- }
|