28 lines
543 B
Go
28 lines
543 B
Go
package pokercore
|
|
|
|
import "testing"
|
|
|
|
type ShuffleTestResults []struct {
|
|
SeedVal int64
|
|
Expected string
|
|
}
|
|
|
|
func TestPokerHand(t *testing.T) {
|
|
//test stuff here
|
|
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)
|
|
}
|
|
}
|