(t *testing.T)
| 293 | } |
| 294 | |
| 295 | func TestImmutableSafeURLString(t *testing.T) { |
| 296 | tests := []struct { |
| 297 | name string |
| 298 | url string |
| 299 | want string |
| 300 | }{ |
| 301 | { |
| 302 | name: "empty renders empty", |
| 303 | url: "", |
| 304 | want: "", |
| 305 | }, |
| 306 | { |
| 307 | name: "renders the wrapped url verbatim without encoding", |
| 308 | url: "https://host/foo/bar baz/?value=x y", |
| 309 | want: "https://host/foo/bar baz/?value=x y", |
| 310 | }, |
| 311 | } |
| 312 | for _, tt := range tests { |
| 313 | t.Run(tt.name, func(t *testing.T) { |
| 314 | require.Equal(t, tt.want, safeurl.NewImmutableSafeURL(tt.url).String()) |
| 315 | }) |
| 316 | } |
| 317 | } |
nothing calls this directly
no test coverage detected