mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-14 18:18:37 +00:00
1 parent
4a79fa0c33
commit
98c12b7b3d
1 file changed
+5
-3
@@ -25,6 +25,8 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
|
||||||
"github.com/spf13/afero"
|
"github.com/spf13/afero"
|
||||||
@@ -149,16 +151,16 @@ func TestGetRealPath(t *testing.T) {
|
|||||||
fs := afero.NewOsFs()
|
fs := afero.NewOsFs()
|
||||||
|
|
||||||
rp1, err := GetRealPath(fs, d1)
|
rp1, err := GetRealPath(fs, d1)
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Equal(t, d1, rp1)
|
assert.Equal(t, d1, rp1)
|
||||||
|
|
||||||
sym := filepath.Join(os.TempDir(), "d1sym")
|
sym := filepath.Join(os.TempDir(), "d1sym")
|
||||||
err = os.Symlink(d1, sym)
|
err = os.Symlink(d1, sym)
|
||||||
|
require.NoError(t, err)
|
||||||
defer os.Remove(sym)
|
defer os.Remove(sym)
|
||||||
assert.NoError(t, err)
|
|
||||||
|
|
||||||
rp2, err := GetRealPath(fs, sym)
|
rp2, err := GetRealPath(fs, sym)
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
// On OS X, the temp folder is itself a symbolic link (to /private...)
|
// On OS X, the temp folder is itself a symbolic link (to /private...)
|
||||||
// This has to do for now.
|
// This has to do for now.
|
||||||
|
|||||||
Reference in new issue
Block a user