test item strings

This commit is contained in:
Branden J Brown 2024-01-21 00:50:54 -06:00
parent 22ec96787f
commit 5466785bbc
1 changed files with 27 additions and 0 deletions

27
game/item_test.go Normal file
View File

@ -0,0 +1,27 @@
package game_test
import (
"testing"
"git.sunturtle.xyz/studio/shotgun/game"
)
func TestItemStrings(t *testing.T) {
cases := []struct {
item game.Item
want string
}{
{game.ItemNone, ""},
{game.ItemLens, "🔍"},
{game.ItemCig, "🚬"},
{game.ItemBeer, "🍺"},
{game.ItemCuff, "👮"},
{game.ItemKnife, "🔪"},
}
for _, c := range cases {
got := c.item.String()
if got != c.want {
t.Errorf("Item(%d).String() == %q, want %q", c.item, got, c.want)
}
}
}