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

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
xinaxu committed Mar 10, 2023
1 parent 6003e8d commit 3d49c5f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions cmd/generate-ipld-car/util/generate-ipld.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (
"github.com/ipld/go-car"
"github.com/pkg/errors"
"io"
"path/filepath"
"strings"
)

Expand Down Expand Up @@ -137,7 +136,7 @@ func GenerateIpldCar(ctx context.Context, input io.Reader, writer io.Writer) (ci
}

relPath := finfo.Path
relSegments := strings.Split(relPath, string(filepath.Separator))
relSegments := strings.Split(relPath, "/")
pos := &rootDir
for i, seg := range relSegments {
last := i == len(relSegments)-1
Expand Down
4 changes: 2 additions & 2 deletions spec/generate-car_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def importToIpfs(path)
end
end

out = `./generate-ipld-car -i test_output/test.ndjson -o test_output -p test_ipld`
out = `./generate-ipld-car -i test_output/test.ndjson -o test_output`
puts out
result = JSON.parse(out)
dataCid = result['DataCid']
Expand All @@ -86,7 +86,7 @@ def importToIpfs(path)
system("ipfs get #{dataCid} -o test_ipld_out")

# Compare test_ipld and test_ipld_out folder to make sure they are the same
expect(`diff -r test_ipld test_ipld_out`).to eq ''
expect(`diff -r test_ipld test_ipld_out/test_ipld`).to eq ''
end
end

Expand Down

0 comments on commit 3d49c5f

Please sign in to comment.