Skip to content

Commit d473f9a

Browse files
stefanhallerantikytheraton
authored andcommitted
Add test to ensure that file icons are one rune
This should prevent errors like that from happening again.
1 parent 2f962c9 commit d473f9a

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package icons
2+
3+
import (
4+
"testing"
5+
)
6+
7+
func TestFileIcons(t *testing.T) {
8+
t.Run("TestFileIcons", func(t *testing.T) {
9+
for name, icon := range nameIconMap {
10+
if len([]rune(icon.Icon)) != 1 {
11+
t.Errorf("nameIconMap[\"%s\"] is not a single rune", name)
12+
}
13+
}
14+
15+
for ext, icon := range extIconMap {
16+
if len([]rune(icon.Icon)) != 1 {
17+
t.Errorf("extIconMap[\"%s\"] is not a single rune", ext)
18+
}
19+
}
20+
})
21+
}

0 commit comments

Comments
 (0)