Skip to content

Commit

Permalink
fix: review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
acha-bill committed Nov 29, 2023
1 parent de97ab0 commit 125d444
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
1 change: 0 additions & 1 deletion cmd/bee/cmd/split.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
"github.com/ethersphere/bee/pkg/file/splitter"
"github.com/ethersphere/bee/pkg/storage"
"github.com/ethersphere/bee/pkg/swarm"

"github.com/spf13/cobra"
)

Expand Down
18 changes: 5 additions & 13 deletions cmd/bee/cmd/split_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ package cmd_test
import (
"bufio"
crand "crypto/rand"
"errors"
"io"
"math/rand"
"os"
"path"
"testing"

"github.com/ethersphere/bee/cmd/bee/cmd"
Expand All @@ -27,13 +26,13 @@ func TestDBSplit(t *testing.T) {
t.Fatal(err)
}

inputFileName := t.TempDir() + "/input"
inputFileName := path.Join(t.TempDir(), "input")
err = os.WriteFile(inputFileName, buf, 0644)
if err != nil {
t.Fatal(err)
}

outputFileName := t.TempDir() + "/output"
outputFileName := path.Join(t.TempDir(), "output")

err = newCommand(t, cmd.WithArgs("split", "--input-file", inputFileName, "--output-file", outputFileName)).Execute()
if err != nil {
Expand All @@ -52,15 +51,8 @@ func TestDBSplit(t *testing.T) {
t.Fatal(err)
}
defer f.Close()
reader := bufio.NewReader(f)
for {
_, err = reader.ReadString('\n')
if err != nil {
if errors.Is(err, io.EOF) {
break
}
t.Fatal(err)
}
scanner := bufio.NewScanner(f)
for scanner.Scan() {
gotHashes++
}

Expand Down

0 comments on commit 125d444

Please sign in to comment.