@@ -221,7 +221,6 @@ func TestLibraryFileURL(t *testing.T) {
221221 for _ , test := range []struct {
222222 desc string
223223 lib * Library
224- path string
225224 wantURL string
226225 wantErr bool
227226 }{
@@ -232,14 +231,13 @@ func TestLibraryFileURL(t *testing.T) {
232231 "github.com/google/trillian" ,
233232 "github.com/google/trillian/crypto" ,
234233 },
235- LicenseFile : "/go/src/github.com/google/trillian/LICENSE " ,
234+ LicenseFile : "/go/src/github.com/google/trillian/foo/README.md " ,
236235 module : & Module {
237236 Path : "github.com/google/trillian" ,
238237 Dir : "/go/src/github.com/google/trillian" ,
239238 Version : "v1.2.3" ,
240239 },
241240 },
242- path : "/go/src/github.com/google/trillian/foo/README.md" ,
243241 wantURL : "https://github.com/google/trillian/blob/v1.2.3/foo/README.md" ,
244242 },
245243 {
@@ -249,14 +247,13 @@ func TestLibraryFileURL(t *testing.T) {
249247 "bitbucket.org/user/project/pkg" ,
250248 "bitbucket.org/user/project/pkg2" ,
251249 },
252- LicenseFile : "/foo/bar/bitbucket.org/user/project/LICENSE " ,
250+ LicenseFile : "/foo/bar/bitbucket.org/user/project/foo/README.md " ,
253251 module : & Module {
254252 Path : "bitbucket.org/user/project" ,
255253 Dir : "/foo/bar/bitbucket.org/user/project" ,
256254 Version : "v1.2.3" ,
257255 },
258256 },
259- path : "/foo/bar/bitbucket.org/user/project/foo/README.md" ,
260257 wantURL : "https://bitbucket.org/user/project/src/v1.2.3/foo/README.md" ,
261258 },
262259 {
@@ -266,14 +263,13 @@ func TestLibraryFileURL(t *testing.T) {
266263 "example.com/user/project/pkg" ,
267264 "example.com/user/project/pkg2" ,
268265 },
269- LicenseFile : "/foo/bar/example.com/user/project/LICENSE " ,
266+ LicenseFile : "/foo/bar/example.com/user/project/foo/README.md " ,
270267 module : & Module {
271268 Path : "example.com/user/project" ,
272269 Dir : "/foo/bar/example.com/user/project" ,
273270 Version : "v1.2.3" ,
274271 },
275272 },
276- path : "/foo/bar/example.com/user/project/foo/README.md" ,
277273 wantURL : "https://example.com/user/project/blob/v1.2.3/foo/README.md" ,
278274 },
279275 {
@@ -283,13 +279,12 @@ func TestLibraryFileURL(t *testing.T) {
283279 "github.com/google/trillian" ,
284280 "github.com/google/trillian/crypto" ,
285281 },
286- LicenseFile : "/go/src/github.com/google/trillian/LICENSE " ,
282+ LicenseFile : "/go/src/github.com/google/trillian/foo/README.md " ,
287283 module : & Module {
288284 Path : "github.com/google/trillian" ,
289285 Dir : "/go/src/github.com/google/trillian" ,
290286 },
291287 },
292- path : "/go/src/github.com/google/trillian/foo/README.md" ,
293288 wantURL : "https://github.com/google/trillian/blob/HEAD/foo/README.md" ,
294289 },
295290 {
@@ -305,20 +300,19 @@ func TestLibraryFileURL(t *testing.T) {
305300 Version : "v0.23.1" ,
306301 },
307302 },
308- path : "/go/modcache/k8s.io/api/LICENSE" ,
309303 wantURL : "https://github.com/kubernetes/api/blob/v0.23.1/LICENSE" ,
310304 },
311305 } {
312306 t .Run (test .desc , func (t * testing.T ) {
313307 client := source .NewClient (time .Second * 20 )
314- fileURL , err := test .lib .FileURL (context .Background (), client , test . path )
308+ fileURL , err := test .lib .FileURL (context .Background (), client )
315309 if gotErr := err != nil ; gotErr != test .wantErr {
316- t .Fatalf ("FileURL(%q ) = (_, %q), want err? %t" , test . path , err , test .wantErr )
310+ t .Fatalf ("FileURL() = (_, %q), want err? %t" , err , test .wantErr )
317311 } else if gotErr {
318312 return
319313 }
320314 if got , want := fileURL , test .wantURL ; got != want {
321- t .Fatalf ("FileURL(%q ) = %q, want %q" , test . path , got , want )
315+ t .Fatalf ("FileURL() = %q, want %q" , got , want )
322316 }
323317 })
324318 }
0 commit comments