go-poker/pokercore/pokercore_test.go

28 lines
543 B
Go
Raw Normal View History

2019-03-23 09:43:25 +00:00
package pokercore
import "testing"
2019-03-23 11:21:03 +00:00
type ShuffleTestResults []struct {
SeedVal int64
Expected string
}
2019-03-23 09:43:25 +00:00
func TestPokerHand(t *testing.T) {
//test stuff here
2019-03-23 11:21:03 +00:00
d := NewDeck()
d.ShuffleDeterministically(437)
cards := d.Deal(7)
//expected := "7C,5S,QS,2D,6D,QC,3H"
expected := "7♣,5♠,Q♠,2♦,6♦,Q♣,3♥"
if s := cards.String(); s != expected {
t.Errorf("didn't get expected cards, got %s", s)
} else {
t.Logf("got expected cards %s", s)
}
x := d.Remaining()
if x != 45 {
t.Errorf("expected 45 left, got %d", x)
}
2019-03-23 09:43:25 +00:00
}