z_test.go 565 B

123456789101112131415161718192021222324252627282930313233343536
  1. package cards_test
  2. import (
  3. "log"
  4. "testing"
  5. "git.ali33.ru/fcg-xvii/cards"
  6. )
  7. func deckOffset(deck *cards.Deck) {
  8. log.Println(deck)
  9. deck.Shuffle()
  10. log.Println(deck)
  11. c, check := deck.PopRight()
  12. for check {
  13. log.Println(c, check)
  14. c, check = deck.PopRight()
  15. }
  16. deck.ResetOffset()
  17. deck.Shuffle()
  18. c, check = deck.PopLeft()
  19. for check {
  20. log.Println(c, check)
  21. c, check = deck.PopLeft()
  22. }
  23. }
  24. func TestDeck32(t *testing.T) {
  25. deck := cards.NewDeck36(2)
  26. deckOffset(deck)
  27. }
  28. func TestDeck54(t *testing.T) {
  29. deck := cards.NewDeck54(2)
  30. deckOffset(deck)
  31. }