mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-08-08 22:36:49 +02:00
Add test to ensure that file icons are one rune
This should prevent errors like that from happening again.
This commit is contained in:
21
pkg/gui/presentation/icons/file_icons_test.go
Normal file
21
pkg/gui/presentation/icons/file_icons_test.go
Normal file
@ -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)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
Reference in New Issue
Block a user