@@ -23,6 +23,7 @@ import (
2323 "github.com/stretchr/testify/suite"
2424
2525 "github.com/fsouza/fake-gcs-server/fakestorage"
26+
2627 "github.com/stellar/go/historyarchive"
2728 "github.com/stellar/go/support/datastore"
2829 "github.com/stellar/go/support/storage"
@@ -100,6 +101,28 @@ func (s *GalexieTestSuite) TestScanAndFill() {
100101
101102 _ , err = datastore .GetFile (s .ctx , "FFFFFFFF--0-9/FFFFFFFA--5.xdr.zstd" )
102103 require .NoError (err )
104+
105+ lastModified , err := datastore .GetFileLastModified (s .ctx , "FFFFFFFF--0-9/FFFFFFFA--5.xdr.zstd" )
106+ require .NoError (err )
107+
108+ // now run an scan-and-fill on an overlapping range, it will skip over existing ledgers
109+ rootCmd .SetArgs ([]string {"scan-and-fill" , "--start" , "4" , "--end" , "9" , "--config-file" , s .tempConfigFile })
110+ errWriter .Reset ()
111+ rootCmd .SetErr (& errWriter )
112+ outWriter .Reset ()
113+ rootCmd .SetOut (& outWriter )
114+ err = rootCmd .ExecuteContext (s .ctx )
115+ require .NoError (err )
116+
117+ s .T ().Log (outWriter .String ())
118+ s .T ().Log (errWriter .String ())
119+
120+ newLastModified , err := datastore .GetFileLastModified (s .ctx , "FFFFFFFF--0-9/FFFFFFFA--5.xdr.zstd" )
121+ require .NoError (err )
122+ require .Equal (lastModified , newLastModified )
123+
124+ _ , err = datastore .GetFile (s .ctx , "FFFFFFFF--0-9/FFFFFFF6--9.xdr.zstd" )
125+ require .NoError (err )
103126}
104127
105128func (s * GalexieTestSuite ) TestAppend () {
@@ -117,7 +140,7 @@ func (s *GalexieTestSuite) TestAppend() {
117140 lastModified , err := datastore .GetFileLastModified (s .ctx , "FFFFFFFF--0-9/FFFFFFF9--6.xdr.zstd" )
118141 require .NoError (err )
119142
120- // now run an append of overalapping range, it will resume past existing ledgers
143+ // now run an append on an overlapping range, it will resume past existing ledgers
121144 rootCmd .SetArgs ([]string {"append" , "--start" , "6" , "--end" , "9" , "--config-file" , s .tempConfigFile })
122145 var errWriter bytes.Buffer
123146 var outWriter bytes.Buffer
0 commit comments