-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from goravel/bowen/fix-windows
fix: windows path
- Loading branch information
Showing
4 changed files
with
39 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# S3 | ||
[utils_test.go](..%2Foss%2Futils_test.go)# S3 | ||
|
||
A s3 disk driver for `facades.Storage()` of Goravel. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package s3 | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestFullPathOfFile(t *testing.T) { | ||
path, err := fullPathOfFile("a/b", &File{path: "logo.png"}, "c") | ||
assert.Equal(t, "a/b/c.png", path) | ||
assert.Nil(t, err) | ||
|
||
path, err = fullPathOfFile("a/b", &File{path: "logo.png"}, "c.jpg") | ||
assert.Equal(t, "a/b/c.jpg", path) | ||
assert.Nil(t, err) | ||
} | ||
|
||
func TestValidPath(t *testing.T) { | ||
assert.Equal(t, "a/", validPath("./a")) | ||
assert.Equal(t, "a/", validPath(".a")) | ||
assert.Equal(t, "a/", validPath("/a")) | ||
assert.Equal(t, "a/", validPath("./a/")) | ||
assert.Equal(t, "a/", validPath(".a/")) | ||
assert.Equal(t, "a/", validPath("/a/")) | ||
assert.Equal(t, "", validPath("./")) | ||
assert.Equal(t, "", validPath(".")) | ||
assert.Equal(t, "", validPath("/")) | ||
} |