github.com/ydb-platform/ydb-go-sdk/v3@v3.57.0/internal/secret/password_test.go (about) 1 package secret 2 3 import ( 4 "testing" 5 6 "github.com/stretchr/testify/require" 7 ) 8 9 func TestPassword(t *testing.T) { 10 for _, tt := range []struct { 11 password string 12 exp string 13 }{ 14 { 15 password: "test", 16 exp: "****", 17 }, 18 { 19 password: "test-long-password", 20 exp: "tes*************rd", 21 }, 22 } { 23 t.Run("", func(t *testing.T) { 24 require.Equal(t, tt.exp, Password(tt.password)) 25 }) 26 } 27 }