Skip to content

Commit

Permalink
Don't change case of extension
Browse files Browse the repository at this point in the history
  • Loading branch information
andydotxyz committed Aug 3, 2020
1 parent 9d56081 commit ace3f62
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion storage/uri.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func NewURI(u string) fyne.URI {
}

func (u *uri) Extension() string {
return strings.ToLower(filepath.Ext(u.raw))
return filepath.Ext(u.raw)
}

func (u *uri) MimeType() string {
Expand Down
5 changes: 2 additions & 3 deletions storage/uri_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ func TestURI_Scheme(t *testing.T) {

func TestURI_Extension(t *testing.T) {
assert.Equal(t, ".txt", storage.NewURI("file:///text.txt").Extension())
assert.Equal(t, ".txt", storage.NewURI("file:///text.tXt").Extension())
assert.Equal(t, ".a", storage.NewURI("file:///library.A").Extension())
assert.Equal(t, ".jpeg", storage.NewURI("file://C:/image.JPEG").Extension())
assert.Equal(t, ".a", storage.NewURI("file:///library.a").Extension())
assert.Equal(t, ".JPEG", storage.NewURI("file://C:/image.JPEG").Extension())
}

0 comments on commit ace3f62

Please sign in to comment.