Skip to content

Commit

Permalink
normalized path separators to URL [#38]
Browse files Browse the repository at this point in the history
  • Loading branch information
bdon committed Nov 12, 2023
1 parent a671a63 commit 17c373d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pmtiles/bucket_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ import (
func TestNormalizeLocalFile(t *testing.T) {
bucket, key, _ := NormalizeBucketKey("", "", "../foo/bar.pmtiles")
assert.Equal(t, "bar.pmtiles", key)
assert.True(t, strings.HasSuffix(bucket, "foo"))
assert.True(t, strings.HasSuffix(bucket, "/foo"))
assert.True(t, strings.HasPrefix(bucket, "file://"))
}

func TestNormalizeLocalFileWindows(t *testing.T) {
if string(os.PathSeparator) != "/" {
bucket, key, _ := NormalizeBucketKey("", "", "\\foo\\bar.pmtiles")
assert.Equal(t, "bar.pmtiles", key)
assert.True(t, strings.HasSuffix(bucket, "\\foo"))
assert.True(t, strings.HasSuffix(bucket, "/foo"))
assert.True(t, strings.HasPrefix(bucket, "file://"))
}
}
Expand Down

0 comments on commit 17c373d

Please sign in to comment.