github.com/secure-build/gitlab-runner@v12.5.0+incompatible/helpers/url/clean_url_test.go (about) 1 package url_helpers 2 3 import ( 4 "testing" 5 6 "github.com/stretchr/testify/assert" 7 ) 8 9 func TestRemovingAllSensitiveData(t *testing.T) { 10 url := CleanURL("https://user:password@gitlab.com/gitlab?key=value#fragment") 11 assert.Equal(t, "https://gitlab.com/gitlab", url) 12 } 13 14 func TestInvalidURL(t *testing.T) { 15 assert.Empty(t, CleanURL("://invalid URL")) 16 }