Skip to content

Commit

Permalink
Add test to ensure that file icons are one rune
Browse files Browse the repository at this point in the history
This should prevent errors like that from happening again.
  • Loading branch information
stefanhaller committed Oct 13, 2024
1 parent f2fd435 commit f71274b
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions pkg/gui/presentation/icons/file_icons_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package icons

import (
"testing"
)

func TestFileIcons(t *testing.T) {
t.Run("TestFileIcons", func(t *testing.T) {
for name, icon := range nameIconMap {
if len([]rune(icon.Icon)) != 1 {
t.Errorf("nameIconMap[\"%s\"] is not a single rune", name)
}
}

for ext, icon := range extIconMap {
if len([]rune(icon.Icon)) != 1 {
t.Errorf("extIconMap[\"%s\"] is not a single rune", ext)
}
}
})
}

0 comments on commit f71274b

Please sign in to comment.