Skip to content

Commit c82517d

Browse files
committed
Improved test error messages
1 parent 84642ef commit c82517d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Diff for: internal/integrationtest/daemon/daemon_core_test.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -79,21 +79,21 @@ func analyzeUpdateIndexStream(t *testing.T, cl commands.ArduinoCoreService_Updat
7979
fmt.Printf("UPDATE> %+v\n", msg)
8080
if progress := msg.GetDownloadProgress(); progress != nil {
8181
if progress.Url != "" && progress.Url != ongoingDownload {
82-
require.Empty(t, ongoingDownload, "DownloadProgress: initiated a new download with closing the previous one")
82+
require.Empty(t, ongoingDownload, "DownloadProgress: started a download without 'completing' the previous one")
8383
ongoingDownload = progress.Url
8484
}
8585
if progress.Completed {
86-
require.NotEmpty(t, ongoingDownload, "DownloadProgress: sent a 'completed' download message without starting it")
86+
require.NotEmpty(t, ongoingDownload, "DownloadProgress: received a 'completed' notification but never initiated a download")
8787
ongoingDownload = ""
8888
}
8989
if progress.Downloaded > 0 {
90-
require.NotEmpty(t, ongoingDownload, "DownloadProgress: sent an update but never initiated a download")
90+
require.NotEmpty(t, ongoingDownload, "DownloadProgress: received a download update but never initiated a download")
9191
}
9292
} else if result := msg.GetDownloadResult(); result != nil {
93-
require.Empty(t, ongoingDownload, "DownloadResult: got a download result with closing it first")
93+
require.Empty(t, ongoingDownload, "DownloadResult: got a download result with completing the current download first")
9494
results[result.Url] = result
9595
} else {
96-
require.FailNow(t, "DownloadProgress: received a message without a Progress or a Result")
96+
require.FailNow(t, "DownloadProgress: received an empty message (without a Progress or a Result)")
9797
}
9898
}
9999
}

0 commit comments

Comments
 (0)