Skip to content

Commit

Permalink
fixing windows tests 1
Browse files Browse the repository at this point in the history
  • Loading branch information
rusq committed Dec 31, 2024
1 parent e4ed521 commit d6f3faa
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
4 changes: 4 additions & 0 deletions cmd/slackdump/internal/diag/encrypt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ func Test_parseArgs(t *testing.T) {

in, out, arm, err := parseArgs([]string{filepath.Join(dir, "foo"), "-"})
require.NoError(t, err)
defer out.Close()
defer in.Close()
assert.Equal(t, os.Stdout, out)
assert.True(t, arm)

Expand All @@ -51,6 +53,8 @@ func Test_parseArgs(t *testing.T) {
dir := t.TempDir()
in, out, arm, err := parseArgs([]string{"-", filepath.Join(dir, "bar")})
require.NoError(t, err)
defer out.Close()
defer in.Close()
assert.Equal(t, os.Stdin, in)
assert.False(t, arm)

Expand Down
3 changes: 2 additions & 1 deletion cmd/slackdump/internal/emoji/emojidl/emoji_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ func generateEmojis(n int) (ret map[string]string) {
}

func randString(n int) string {
var chars = []rune("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")
chars := []rune("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")

b := make([]rune, n)
for i := range b {
Expand Down Expand Up @@ -334,6 +334,7 @@ func Test_download(t *testing.T) {
if err != nil {
t.Fatal(err)
}
defer fs.Close()
if err := DlFS(tt.args.ctx, sess, fs, tt.args.failFast, nil); (err != nil) != tt.wantErr {
t.Errorf("download() error = %v, wantErr %v", err, tt.wantErr)
}
Expand Down
12 changes: 7 additions & 5 deletions cmd/slackdump/internal/export/v3_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (

"github.com/rusq/fsadapter"
"github.com/rusq/slack"

"github.com/rusq/slackdump/v3"
"github.com/rusq/slackdump/v3/internal/chunk"
"github.com/rusq/slackdump/v3/internal/chunk/chunktest"
Expand All @@ -16,15 +17,16 @@ import (
"github.com/rusq/slackdump/v3/internal/structures"
)

const (
baseDir = "../../../../"
chunkDir = baseDir + "tmp/2/"
guestDir = baseDir + "tmp/guest/"
largeFile = chunkDir + "C0BBSGYFN.json.gz"
var (
baseDir = filepath.Join("..", "..", "..", "..")
chunkDir = filepath.Join(baseDir, "tmp", "2")
guestDir = filepath.Join(baseDir, "tmp", "guest")
largeFile = filepath.Join(chunkDir, "C0BBSGYFN.json.gz")
)

func Test_exportV3(t *testing.T) {
fixtures.SkipInCI(t)
fixtures.SkipOnWindows(t)
// // TODO: this is manual
// t.Run("large file", func(t *testing.T) {
// srv := chunktest.NewDirServer(chunkDir)
Expand Down

0 comments on commit d6f3faa

Please sign in to comment.