package reddit_test import ( "testing" "github.com/stretchr/testify/assert" "github.com/christianselig/apollo-backend/internal/reddit" ) func TestAuthenticatedClientObfuscatedToken(t *testing.T) { t.Parallel() rc := reddit.NewClient("", "", nil, nil, 1) type test struct { have string want string } tests := []test{ {"abc", ""}, {"abcdefghi", "abc...ghi"}, } for _, tc := range tests { tc := tc rac := rc.NewAuthenticatedClient("", "", tc.have) got := rac.ObfuscatedAccessToken() assert.Equal(t, tc.want, got) } }