From 34256bf247a0ddf56193184a68f03b7a0281badf Mon Sep 17 00:00:00 2001 From: Achilleas Koutsou Date: Tue, 12 Mar 2024 19:18:16 +0100 Subject: [PATCH] uploader: test the progress upload output with a regex The length of the progress bar depends on the terminal width so let's make the test matching flexible. --- bib/internal/uploader/aws_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bib/internal/uploader/aws_test.go b/bib/internal/uploader/aws_test.go index 5af393a0..2522a791 100644 --- a/bib/internal/uploader/aws_test.go +++ b/bib/internal/uploader/aws_test.go @@ -81,6 +81,6 @@ func TestUploadAndRegisterProgressBar(t *testing.T) { assert.Equal(t, fakeUploader.registerCalled, 1) assert.Contains(t, fakeStdout.String(), "Uploading ") - assert.Contains(t, fakeStdout.String(), "10.00 MiB / 10.00 MiB [============================================] 100.00%") + assert.Regexp(t, `10.00 MiB / 10.00 MiB \[=+\] 100.00%`, fakeStdout.String()) assert.Contains(t, fakeStdout.String(), "Registering AMI ") }