@@ -437,6 +437,40 @@ func TestGCSListFilePaths(t *testing.T) {
437437 require .Equal (t , []string {"a" , "b" }, paths )
438438}
439439
440+ func TestGCSListFilePaths_NoPrefix (t * testing.T ) {
441+ server := fakestorage .NewServer ([]fakestorage.Object {
442+ {
443+ ObjectAttrs : fakestorage.ObjectAttrs {BucketName : "test-bucket" , Name : "a" },
444+ Content : []byte ("1" ),
445+ },
446+ {
447+ ObjectAttrs : fakestorage.ObjectAttrs {BucketName : "test-bucket" , Name : "b" },
448+ Content : []byte ("1" ),
449+ },
450+ {
451+ ObjectAttrs : fakestorage.ObjectAttrs {BucketName : "test-bucket" , Name : "c" },
452+ Content : []byte ("1" ),
453+ },
454+ })
455+ defer server .Stop ()
456+
457+ store , err := FromGCSClient (context .Background (), server .Client (), "test-bucket" )
458+ require .NoError (t , err )
459+ t .Cleanup (func () { _ = store .Close () })
460+
461+ paths , err := store .ListFilePaths (context .Background (), ListFileOptions {})
462+ require .NoError (t , err )
463+ require .Equal (t , []string {"a" , "b" , "c" }, paths )
464+
465+ paths , err = store .ListFilePaths (context .Background (), ListFileOptions {Limit : 2 })
466+ require .NoError (t , err )
467+ require .Equal (t , []string {"a" , "b" }, paths )
468+
469+ paths , err = store .ListFilePaths (context .Background (), ListFileOptions {StartAfter : "a" })
470+ require .NoError (t , err )
471+ require .Equal (t , []string {"b" , "c" }, paths )
472+ }
473+
440474func TestGCSListFilePaths_WithPrefix (t * testing.T ) {
441475 server := fakestorage .NewServer ([]fakestorage.Object {
442476 {
0 commit comments