Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
  • Loading branch information
jkroepke committed Jul 23, 2024
1 parent 2af360b commit 29d709a
Showing 1 changed file with 4 additions and 19 deletions.
23 changes: 4 additions & 19 deletions internal/provider/tar_archiver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"io"
"os"
"path/filepath"
"regexp"
"strconv"
"testing"
"time"
Expand Down Expand Up @@ -255,15 +254,8 @@ func TestTarArchiver_Dir_ExcludeSymlinkDirectories(t *testing.T) {
ExcludeSymlinkDirectories: true,
})

if err == nil {
t.Fatalf("expected error, but err is nil.")
}

regex := regexp.MustCompile(`error reading file for archival: read test-fixtures[/\\]test-dir-with-symlink-dir[/\\]test-symlink-dir: `)
found := regex.Match([]byte(err.Error()))

if !found {
t.Fatalf("expected error to match %q, got: %s", regex.String(), err.Error())
if err != nil {
t.Errorf("expected no error: %s", err)
}
}

Expand Down Expand Up @@ -311,15 +303,8 @@ func TestTarArchiver_Dir_Exclude_ExcludeSymlinkDirectories(t *testing.T) {
ExcludeSymlinkDirectories: true,
})

if err == nil {
t.Fatalf("expected error, but err is nil.")
}

regex := regexp.MustCompile(`error reading file for archival: read test-fixtures[/\\]test-dir-with-symlink-dir[/\\]test-symlink-dir: `)
found := regex.Match([]byte(err.Error()))

if !found {
t.Fatalf("expedted error to match %q, got: %s", regex.String(), err.Error())
if err != nil {
t.Errorf("expected no error: %s", err)
}
}

Expand Down

0 comments on commit 29d709a

Please sign in to comment.