test item strings
This commit is contained in:
parent
22ec96787f
commit
5466785bbc
27
game/item_test.go
Normal file
27
game/item_test.go
Normal 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)
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user