Skip to content
This repository has been archived by the owner on Dec 29, 2024. It is now read-only.

Commit

Permalink
fix(config): add expected result in config_file_test
Browse files Browse the repository at this point in the history
  • Loading branch information
Wittano committed Nov 28, 2023
1 parent 18334bd commit 72877c3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions setting/config_file_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package setting
import (
"fmt"
"github.com/wittano/filebot/internal/test"
"golang.org/x/exp/slices"
"os"
"testing"
)
Expand Down Expand Up @@ -51,9 +52,12 @@ func TestGetTrashDir(t *testing.T) {
t.Fatal("MoveToTrash field is false")
}

exp := fmt.Sprintf("/tmp/.Trash-%d/files", os.Getuid())
exp := []string{
fmt.Sprintf("/tmp/.Trash-%d/files", os.Getuid()),
fmt.Sprintf("%s/.local/share/.Trash-%d/files", os.Getenv("HOME"), os.Getuid()),
}

if exp != res {
t.Fatalf("Trash dir is diffrent. Expected: %s, Actually: %s", exp, res)
if !slices.Contains(exp, res) {
t.Fatalf("Trash dir is diffrent. Expected one of them: %v, Actually: %s", exp, res)
}
}

0 comments on commit 72877c3

Please sign in to comment.