This fixes various test issues with Go 1.20. - Most tests rewritten to use fakefs where possible - Some tests that were already skipped, or dubious (invasive, unmaintainable, unclear what they even tested) have been removed - Some actual code rewritten to better support testing in fakefs Co-authored-by: Eric P <eric@kastelo.net>
This commit is contained in:
@@ -60,7 +60,7 @@ func TestProgressEmitter(t *testing.T) {
|
||||
|
||||
w := evLogger.Subscribe(events.DownloadProgress)
|
||||
|
||||
c, cfgCancel := createTmpWrapper(config.Configuration{})
|
||||
c, cfgCancel := newConfigWrapper(config.Configuration{Version: config.CurrentVersion})
|
||||
defer os.Remove(c.ConfigPath())
|
||||
defer cfgCancel()
|
||||
waiter, err := c.Modify(func(cfg *config.Configuration) {
|
||||
@@ -110,11 +110,10 @@ func TestProgressEmitter(t *testing.T) {
|
||||
|
||||
expectEvent(w, t, 0)
|
||||
expectTimeout(w, t)
|
||||
|
||||
}
|
||||
|
||||
func TestSendDownloadProgressMessages(t *testing.T) {
|
||||
c, cfgCancel := createTmpWrapper(config.Configuration{})
|
||||
c, cfgCancel := newConfigWrapper(config.Configuration{Version: config.CurrentVersion})
|
||||
defer os.Remove(c.ConfigPath())
|
||||
defer cfgCancel()
|
||||
waiter, err := c.Modify(func(cfg *config.Configuration) {
|
||||
@@ -455,8 +454,8 @@ func TestSendDownloadProgressMessages(t *testing.T) {
|
||||
|
||||
// See progressemitter.go for explanation why this is commented out.
|
||||
// Search for state.cleanup
|
||||
//expect(-1, state2, protocol.FileDownloadProgressUpdateTypeForget, v1, nil, false)
|
||||
//expect(-1, state4, protocol.FileDownloadProgressUpdateTypeForget, v1, nil, true)
|
||||
// expect(-1, state2, protocol.FileDownloadProgressUpdateTypeForget, v1, nil, false)
|
||||
// expect(-1, state4, protocol.FileDownloadProgressUpdateTypeForget, v1, nil, true)
|
||||
|
||||
expectEmpty()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user