mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-03 01:41:48 +00:00
*: fix tests failing due to path.Join usage
Solution: Use `file/filepath` package to construct expected path. This package is OS-aware, see https://github.com/golang/go/issues/30616.
This commit is contained in:
parent
6cdb701a9d
commit
aefb6f9fee
21 changed files with 118 additions and 116 deletions
|
@ -1,7 +1,7 @@
|
|||
package server
|
||||
|
||||
import (
|
||||
"path"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
|
@ -11,13 +11,13 @@ func TestGetPath(t *testing.T) {
|
|||
testPath := t.TempDir()
|
||||
actual, err := getPath(testPath, 123)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, path.Join(testPath, "/BlockStorage_100000/dump-block-1000.json"), actual)
|
||||
require.Equal(t, filepath.Join(testPath, "BlockStorage_100000", "dump-block-1000.json"), actual)
|
||||
|
||||
actual, err = getPath(testPath, 1230)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, path.Join(testPath, "/BlockStorage_100000/dump-block-2000.json"), actual)
|
||||
require.Equal(t, filepath.Join(testPath, "BlockStorage_100000", "dump-block-2000.json"), actual)
|
||||
|
||||
actual, err = getPath(testPath, 123000)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, path.Join(testPath, "/BlockStorage_200000/dump-block-123000.json"), actual)
|
||||
require.Equal(t, filepath.Join(testPath, "BlockStorage_200000", "dump-block-123000.json"), actual)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue