Skip to content

Commit

Permalink
windows path separators [#38]
Browse files Browse the repository at this point in the history
  • Loading branch information
bdon committed Nov 12, 2023
1 parent 3bcea87 commit a671a63
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 a671a63

Please sign in to comment.