Browse Source

Reformat test data

master v0.1.2
Trevor Slocum 2 years ago
parent
commit
03b9695778
  1. 3
      CHANGELOG
  2. 480
      score_test.go

3
CHANGELOG

@ -1,3 +1,6 @@
0.1.2:
- Update joker
0.1.1:
- Rename library from cards-cribbage to joker-cribbage
- Remove dependency on permutation library

480
score_test.go

@ -7,19 +7,72 @@ import (
)
var (
testHandA = Cards{Card{Face2, SuitSpades}, Card{Face3, SuitSpades}, Card{Face4, SuitSpades}, Card{Face5, SuitSpades}}
testHandB = Cards{Card{FaceJack, SuitHearts}, Card{Face5, SuitDiamonds}, Card{Face5, SuitClubs}, Card{Face5, SuitSpades}}
testHandC = Cards{Card{Face3, SuitHearts}, Card{Face3, SuitDiamonds}, Card{Face3, SuitClubs}, Card{Face3, SuitSpades}}
testHandD = Cards{Card{Face5, SuitHearts}, Card{Face5, SuitDiamonds}, Card{Face5, SuitClubs}, Card{Face5, SuitSpades}}
testHandE = Cards{Card{Face7, SuitHearts}, Card{Face8, SuitHearts}, Card{Face9, SuitHearts}, Card{Face10, SuitHearts}}
testHandF = Cards{Card{Face3, SuitHearts}, Card{Face6, SuitHearts}, Card{Face5, SuitHearts}, Card{Face4, SuitHearts}}
testHandG = Cards{Card{Face6, SuitHearts}, Card{Face5, SuitHearts}, Card{Face4, SuitHearts}}
testHandH = Cards{Card{FaceAce, SuitHearts}, Card{Face3, SuitHearts}, Card{Face2, SuitHearts}, Card{Face4, SuitHearts}}
testHandI = Cards{Card{FaceAce, SuitHearts}, Card{Face3, SuitHearts}, Card{FaceAce, SuitClubs}, Card{Face2, SuitHearts}, Card{Face4, SuitHearts}, Card{Face7, SuitHearts}}
testHandJ = Cards{Card{Face7, SuitHearts}, Card{Face3, SuitHearts}, Card{Face2, SuitHearts}, Card{Face4, SuitHearts}}
testHandK = Cards{Card{Face5, SuitHearts}, Card{Face5, SuitDiamonds}, Card{Face5, SuitClubs}, Card{FaceJack, SuitSpades}}
testHandL = Cards{Card{Face2, SuitHearts}, Card{Face2, SuitDiamonds}, Card{Face7, SuitClubs}, Card{Face7, SuitSpades}}
testHandM = Cards{Card{Face5, SuitHearts}, Card{Face5, SuitDiamonds}, Card{Face5, SuitClubs}, Card{FaceKing, SuitSpades}}
testHandA = Cards{
Card{Face2, SuitSpades},
Card{Face3, SuitSpades},
Card{Face4, SuitSpades},
Card{Face5, SuitSpades}}
testHandB = Cards{
Card{FaceJack, SuitHearts},
Card{Face5, SuitDiamonds},
Card{Face5, SuitClubs},
Card{Face5, SuitSpades}}
testHandC = Cards{
Card{Face3, SuitHearts},
Card{Face3, SuitDiamonds},
Card{Face3, SuitClubs},
Card{Face3, SuitSpades}}
testHandD = Cards{
Card{Face5, SuitHearts},
Card{Face5, SuitDiamonds},
Card{Face5, SuitClubs},
Card{Face5, SuitSpades}}
testHandE = Cards{
Card{Face7, SuitHearts},
Card{Face8, SuitHearts},
Card{Face9, SuitHearts},
Card{Face10, SuitHearts}}
testHandF = Cards{
Card{Face3, SuitHearts},
Card{Face6, SuitHearts},
Card{Face5, SuitHearts},
Card{Face4, SuitHearts}}
testHandG = Cards{
Card{Face6, SuitHearts},
Card{Face5, SuitHearts},
Card{Face4, SuitHearts}}
testHandH = Cards{
Card{FaceAce, SuitHearts},
Card{Face3, SuitHearts},
Card{Face2, SuitHearts},
Card{Face4, SuitHearts}}
testHandI = Cards{
Card{FaceAce, SuitHearts},
Card{Face3, SuitHearts},
Card{FaceAce, SuitClubs},
Card{Face2, SuitHearts},
Card{Face4, SuitHearts},
Card{Face7, SuitHearts}}
testHandJ = Cards{
Card{Face7, SuitHearts},
Card{Face3, SuitHearts},
Card{Face2, SuitHearts},
Card{Face4, SuitHearts}}
testHandK = Cards{
Card{Face5, SuitHearts},
Card{Face5, SuitDiamonds},
Card{Face5, SuitClubs},
Card{FaceJack, SuitSpades}}
testHandL = Cards{
Card{Face2, SuitHearts},
Card{Face2, SuitDiamonds},
Card{Face7, SuitClubs},
Card{Face7, SuitSpades}}
testHandM = Cards{
Card{Face5, SuitHearts},
Card{Face5, SuitDiamonds},
Card{Face5, SuitClubs},
Card{FaceKing, SuitSpades}}
)
type expectedPegScore struct {
@ -29,16 +82,52 @@ type expectedPegScore struct {
}
var expectedPegScores = []expectedPegScore{
{testHandA, []ScoreResult{{Type: ScoreRun, Points: 4, Cards: Cards{Card{Face2, SuitSpades}, Card{Face3, SuitSpades}, Card{Face4, SuitSpades}, Card{Face5, SuitSpades}}}}},
{testHandB, []ScoreResult{{Type: ScorePair, Points: 6, Cards: Cards{Card{Face5, SuitDiamonds}, Card{Face5, SuitClubs}, Card{Face5, SuitSpades}}}}},
{testHandC, []ScoreResult{{Type: ScorePair, Points: 12, Cards: Cards{Card{Face3, SuitHearts}, Card{Face3, SuitDiamonds}, Card{Face3, SuitClubs}, Card{Face3, SuitSpades}}}}},
{testHandF, []ScoreResult{{Type: ScoreRun, Points: 4, Cards: Cards{Card{Face3, SuitHearts}, Card{Face4, SuitHearts}, Card{Face5, SuitHearts}, Card{Face6, SuitHearts}}}}},
{testHandG, []ScoreResult{{Type: Score15, Points: 2, Cards: Cards{Card{Face4, SuitHearts}, Card{Face5, SuitHearts}, Card{Face6, SuitHearts}}}, {Type: ScoreRun, Points: 3, Cards: Cards{Card{Face4, SuitHearts}, Card{Face5, SuitHearts}, Card{Face6, SuitHearts}}}}},
{testHandH, []ScoreResult{{Type: ScoreRun, Points: 4, Cards: Cards{Card{FaceAce, SuitHearts}, Card{Face2, SuitHearts}, Card{Face3, SuitHearts}, Card{Face4, SuitHearts}}}}},
{testHandA, []ScoreResult{
{Type: ScoreRun, Points: 4, Cards: Cards{
Card{Face2, SuitSpades},
Card{Face3, SuitSpades},
Card{Face4, SuitSpades},
Card{Face5, SuitSpades}}}}},
{testHandB, []ScoreResult{
{Type: ScorePair, Points: 6, Cards: Cards{
Card{Face5, SuitDiamonds},
Card{Face5, SuitClubs},
Card{Face5, SuitSpades}}}}},
{testHandC, []ScoreResult{
{Type: ScorePair, Points: 12, Cards: Cards{
Card{Face3, SuitHearts},
Card{Face3, SuitDiamonds},
Card{Face3, SuitClubs},
Card{Face3, SuitSpades}}}}},
{testHandF, []ScoreResult{
{Type: ScoreRun, Points: 4, Cards: Cards{
Card{Face3, SuitHearts},
Card{Face4, SuitHearts},
Card{Face5, SuitHearts},
Card{Face6, SuitHearts}}}}},
{testHandG, []ScoreResult{
{Type: Score15, Points: 2, Cards: Cards{
Card{Face4, SuitHearts},
Card{Face5, SuitHearts},
Card{Face6, SuitHearts}}},
{Type: ScoreRun, Points: 3, Cards: Cards{
Card{Face4, SuitHearts},
Card{Face5, SuitHearts},
Card{Face6, SuitHearts}}}}},
{testHandH, []ScoreResult{
{Type: ScoreRun, Points: 4, Cards: Cards{
Card{FaceAce, SuitHearts},
Card{Face2, SuitHearts},
Card{Face3, SuitHearts},
Card{Face4, SuitHearts}}}}},
{testHandI, []ScoreResult{}},
{testHandJ, []ScoreResult{{Type: ScoreRun, Points: 3}}},
{testHandJ, []ScoreResult{
{Type: ScoreRun, Points: 3}}},
{testHandK, []ScoreResult{}},
{testHandL, []ScoreResult{{Type: ScorePair, Points: 2, Cards: Cards{Card{Face7, SuitClubs}, Card{Face7, SuitSpades}}}}},
{testHandL, []ScoreResult{
{Type: ScorePair, Points: 2, Cards: Cards{
Card{Face7, SuitClubs},
Card{Face7, SuitSpades}}}}},
{testHandM, []ScoreResult{}},
}
@ -51,87 +140,274 @@ type expectedShowScore struct {
}
var expectedShowScores = []expectedShowScore{
{Card{FaceAce, SuitSpades}, testHandA, []ScoreResult{
{Type: Score15, Points: 2, Cards: Cards{Card{FaceAce, SuitSpades}, Card{Face2, SuitSpades}, Card{Face3, SuitSpades}, Card{Face4, SuitSpades}, Card{Face5, SuitSpades}}},
{Type: ScoreRun, Points: 5, Cards: Cards{Card{FaceAce, SuitSpades}, Card{Face2, SuitSpades}, Card{Face3, SuitSpades}, Card{Face4, SuitSpades}, Card{Face5, SuitSpades}}},
{Type: ScoreFlush, Points: 5, Cards: Cards{Card{FaceAce, SuitSpades}, Card{Face2, SuitSpades}, Card{Face3, SuitSpades}, Card{Face4, SuitSpades}, Card{Face5, SuitSpades}}},
}, []ScoreResult{
{Type: Score15, Points: 2, Cards: Cards{Card{FaceAce, SuitSpades}, Card{Face2, SuitSpades}, Card{Face3, SuitSpades}, Card{Face4, SuitSpades}, Card{Face5, SuitSpades}}},
{Type: ScoreRun, Points: 5, Cards: Cards{Card{FaceAce, SuitSpades}, Card{Face2, SuitSpades}, Card{Face3, SuitSpades}, Card{Face4, SuitSpades}, Card{Face5, SuitSpades}}},
{Type: ScoreFlush, Points: 5, Cards: Cards{Card{FaceAce, SuitSpades}, Card{Face2, SuitSpades}, Card{Face3, SuitSpades}, Card{Face4, SuitSpades}, Card{Face5, SuitSpades}}},
}},
{Card{FaceKing, SuitClubs}, testHandA, []ScoreResult{
{Type: Score15, Points: 2, Cards: Cards{Card{Face5, SuitSpades}, Card{FaceKing, SuitClubs}}},
{Type: Score15, Points: 2, Cards: Cards{Card{Face2, SuitSpades}, Card{Face3, SuitSpades}, Card{FaceKing, SuitClubs}}},
{Type: ScoreRun, Points: 4, Cards: Cards{Card{Face2, SuitSpades}, Card{Face3, SuitSpades}, Card{Face4, SuitSpades}, Card{Face5, SuitSpades}}},
{Type: ScoreFlush, Points: 4, Cards: Cards{Card{Face2, SuitSpades}, Card{Face3, SuitSpades}, Card{Face4, SuitSpades}, Card{Face5, SuitSpades}}},
}, []ScoreResult{
{Type: Score15, Points: 2, Cards: Cards{Card{Face5, SuitSpades}, Card{FaceKing, SuitClubs}}},
{Type: Score15, Points: 2, Cards: Cards{Card{Face2, SuitSpades}, Card{Face3, SuitSpades}, Card{FaceKing, SuitClubs}}},
{Type: ScoreRun, Points: 4, Cards: Cards{Card{Face2, SuitSpades}, Card{Face3, SuitSpades}, Card{Face4, SuitSpades}, Card{Face5, SuitSpades}}},
}},
{Card{Face8, SuitClubs}, testHandE, []ScoreResult{
{Type: Score15, Points: 2, Cards: Cards{Card{Face7, SuitHearts}, Card{Face8, SuitHearts}}},
{Type: Score15, Points: 2, Cards: Cards{Card{Face7, SuitHearts}, Card{Face8, SuitClubs}}},
{Type: ScorePair, Points: 2, Cards: Cards{Card{Face8, SuitHearts}, Card{Face8, SuitClubs}}},
{Type: ScoreRun, Points: 4, Cards: Cards{Card{Face7, SuitHearts}, Card{Face8, SuitHearts}, Card{Face9, SuitHearts}, Card{Face10, SuitHearts}}},
{Type: ScoreRun, Points: 4, Cards: Cards{Card{Face7, SuitHearts}, Card{Face8, SuitClubs}, Card{Face9, SuitHearts}, Card{Face10, SuitHearts}}},
{Type: ScoreFlush, Points: 4, Cards: Cards{Card{Face7, SuitHearts}, Card{Face8, SuitHearts}, Card{Face9, SuitHearts}, Card{Face10, SuitHearts}}},
}, []ScoreResult{
{Type: Score15, Points: 2, Cards: Cards{Card{Face7, SuitHearts}, Card{Face8, SuitHearts}}},
{Type: Score15, Points: 2, Cards: Cards{Card{Face7, SuitHearts}, Card{Face8, SuitClubs}}},
{Type: ScorePair, Points: 2, Cards: Cards{Card{Face8, SuitHearts}, Card{Face8, SuitClubs}}},
{Type: ScoreRun, Points: 4, Cards: Cards{Card{Face7, SuitHearts}, Card{Face8, SuitHearts}, Card{Face9, SuitHearts}, Card{Face10, SuitHearts}}},
{Type: ScoreRun, Points: 4, Cards: Cards{Card{Face7, SuitHearts}, Card{Face8, SuitClubs}, Card{Face9, SuitHearts}, Card{Face10, SuitHearts}}},
}},
{Card{Face5, SuitSpades}, testHandK, []ScoreResult{
{Type: Score15, Points: 2, Cards: Cards{Card{Face5, SuitHearts}, Card{FaceJack, SuitSpades}}},
{Type: Score15, Points: 2, Cards: Cards{Card{Face5, SuitDiamonds}, Card{FaceJack, SuitSpades}}},
{Type: Score15, Points: 2, Cards: Cards{Card{Face5, SuitClubs}, Card{FaceJack, SuitSpades}}},
{Type: Score15, Points: 2, Cards: Cards{Card{Face5, SuitSpades}, Card{FaceJack, SuitSpades}}},
{Type: Score15, Points: 2, Cards: Cards{Card{Face5, SuitHearts}, Card{Face5, SuitDiamonds}, Card{Face5, SuitClubs}}},
{Type: Score15, Points: 2, Cards: Cards{Card{Face5, SuitHearts}, Card{Face5, SuitDiamonds}, Card{Face5, SuitSpades}}},
{Type: Score15, Points: 2, Cards: Cards{Card{Face5, SuitHearts}, Card{Face5, SuitClubs}, Card{Face5, SuitSpades}}},
{Type: Score15, Points: 2, Cards: Cards{Card{Face5, SuitDiamonds}, Card{Face5, SuitClubs}, Card{Face5, SuitSpades}}},
{Type: ScorePair, Points: 12, Cards: Cards{Card{Face5, SuitHearts}, Card{Face5, SuitDiamonds}, Card{Face5, SuitClubs}, Card{Face5, SuitSpades}}},
{Type: ScoreNobs, Points: 1, Cards: Cards{Card{FaceJack, SuitSpades}}},
}, []ScoreResult{
{Type: Score15, Points: 2, Cards: Cards{Card{Face5, SuitHearts}, Card{FaceJack, SuitSpades}}},
{Type: Score15, Points: 2, Cards: Cards{Card{Face5, SuitDiamonds}, Card{FaceJack, SuitSpades}}},
{Type: Score15, Points: 2, Cards: Cards{Card{Face5, SuitClubs}, Card{FaceJack, SuitSpades}}},
{Type: Score15, Points: 2, Cards: Cards{Card{Face5, SuitSpades}, Card{FaceJack, SuitSpades}}},
{Type: Score15, Points: 2, Cards: Cards{Card{Face5, SuitHearts}, Card{Face5, SuitDiamonds}, Card{Face5, SuitClubs}}},
{Type: Score15, Points: 2, Cards: Cards{Card{Face5, SuitHearts}, Card{Face5, SuitDiamonds}, Card{Face5, SuitSpades}}},
{Type: Score15, Points: 2, Cards: Cards{Card{Face5, SuitHearts}, Card{Face5, SuitClubs}, Card{Face5, SuitSpades}}},
{Type: Score15, Points: 2, Cards: Cards{Card{Face5, SuitDiamonds}, Card{Face5, SuitClubs}, Card{Face5, SuitSpades}}},
{Type: ScorePair, Points: 12, Cards: Cards{Card{Face5, SuitHearts}, Card{Face5, SuitDiamonds}, Card{Face5, SuitClubs}, Card{Face5, SuitSpades}}},
{Type: ScoreNobs, Points: 1, Cards: Cards{Card{FaceJack, SuitSpades}}},
}},
{Card{Face5, SuitSpades}, testHandM, []ScoreResult{
{Type: Score15, Points: 2, Cards: Cards{Card{Face5, SuitHearts}, Card{FaceKing, SuitSpades}}},
{Type: Score15, Points: 2, Cards: Cards{Card{Face5, SuitDiamonds}, Card{FaceKing, SuitSpades}}},
{Type: Score15, Points: 2, Cards: Cards{Card{Face5, SuitClubs}, Card{FaceKing, SuitSpades}}},
{Type: Score15, Points: 2, Cards: Cards{Card{Face5, SuitSpades}, Card{FaceKing, SuitSpades}}},
{Type: Score15, Points: 2, Cards: Cards{Card{Face5, SuitHearts}, Card{Face5, SuitDiamonds}, Card{Face5, SuitClubs}}},
{Type: Score15, Points: 2, Cards: Cards{Card{Face5, SuitHearts}, Card{Face5, SuitDiamonds}, Card{Face5, SuitSpades}}},
{Type: Score15, Points: 2, Cards: Cards{Card{Face5, SuitHearts}, Card{Face5, SuitClubs}, Card{Face5, SuitSpades}}},
{Type: Score15, Points: 2, Cards: Cards{Card{Face5, SuitDiamonds}, Card{Face5, SuitClubs}, Card{Face5, SuitSpades}}},
{Type: ScorePair, Points: 12, Cards: Cards{Card{Face5, SuitHearts}, Card{Face5, SuitDiamonds}, Card{Face5, SuitClubs}, Card{Face5, SuitSpades}}},
}, []ScoreResult{
{Type: Score15, Points: 2, Cards: Cards{Card{Face5, SuitHearts}, Card{FaceKing, SuitSpades}}},
{Type: Score15, Points: 2, Cards: Cards{Card{Face5, SuitDiamonds}, Card{FaceKing, SuitSpades}}},
{Type: Score15, Points: 2, Cards: Cards{Card{Face5, SuitClubs}, Card{FaceKing, SuitSpades}}},
{Type: Score15, Points: 2, Cards: Cards{Card{Face5, SuitSpades}, Card{FaceKing, SuitSpades}}},
{Type: Score15, Points: 2, Cards: Cards{Card{Face5, SuitHearts}, Card{Face5, SuitDiamonds}, Card{Face5, SuitClubs}}},
{Type: Score15, Points: 2, Cards: Cards{Card{Face5, SuitHearts}, Card{Face5, SuitDiamonds}, Card{Face5, SuitSpades}}},
{Type: Score15, Points: 2, Cards: Cards{Card{Face5, SuitHearts}, Card{Face5, SuitClubs}, Card{Face5, SuitSpades}}},
{Type: Score15, Points: 2, Cards: Cards{Card{Face5, SuitDiamonds}, Card{Face5, SuitClubs}, Card{Face5, SuitSpades}}},
{Type: ScorePair, Points: 12, Cards: Cards{Card{Face5, SuitHearts}, Card{Face5, SuitDiamonds}, Card{Face5, SuitClubs}, Card{Face5, SuitSpades}}},
}},
{Card{FaceAce, SuitSpades},
testHandA, []ScoreResult{
{Type: Score15, Points: 2, Cards: Cards{
Card{FaceAce, SuitSpades},
Card{Face2, SuitSpades},
Card{Face3, SuitSpades},
Card{Face4, SuitSpades},
Card{Face5, SuitSpades}}},
{Type: ScoreRun, Points: 5, Cards: Cards{
Card{FaceAce, SuitSpades},
Card{Face2, SuitSpades},
Card{Face3, SuitSpades},
Card{Face4, SuitSpades},
Card{Face5, SuitSpades}}},
{Type: ScoreFlush, Points: 5, Cards: Cards{
Card{FaceAce, SuitSpades},
Card{Face2, SuitSpades},
Card{Face3, SuitSpades},
Card{Face4, SuitSpades},
Card{Face5, SuitSpades}}},
}, []ScoreResult{
{Type: Score15, Points: 2, Cards: Cards{
Card{FaceAce, SuitSpades},
Card{Face2, SuitSpades},
Card{Face3, SuitSpades},
Card{Face4, SuitSpades},
Card{Face5, SuitSpades}}},
{Type: ScoreRun, Points: 5, Cards: Cards{
Card{FaceAce, SuitSpades},
Card{Face2, SuitSpades},
Card{Face3, SuitSpades},
Card{Face4, SuitSpades},
Card{Face5, SuitSpades}}},
{Type: ScoreFlush, Points: 5, Cards: Cards{
Card{FaceAce, SuitSpades},
Card{Face2, SuitSpades},
Card{Face3, SuitSpades},
Card{Face4, SuitSpades},
Card{Face5, SuitSpades}}},
}},
{Card{FaceKing, SuitClubs},
testHandA, []ScoreResult{
{Type: Score15, Points: 2, Cards: Cards{
Card{Face5, SuitSpades},
Card{FaceKing, SuitClubs}}},
{Type: Score15, Points: 2, Cards: Cards{
Card{Face2, SuitSpades},
Card{Face3, SuitSpades},
Card{FaceKing, SuitClubs}}},
{Type: ScoreRun, Points: 4, Cards: Cards{
Card{Face2, SuitSpades},
Card{Face3, SuitSpades},
Card{Face4, SuitSpades},
Card{Face5, SuitSpades}}},
{Type: ScoreFlush, Points: 4, Cards: Cards{
Card{Face2, SuitSpades},
Card{Face3, SuitSpades},
Card{Face4, SuitSpades},
Card{Face5, SuitSpades}}},
}, []ScoreResult{
{Type: Score15, Points: 2, Cards: Cards{
Card{Face5, SuitSpades},
Card{FaceKing, SuitClubs}}},
{Type: Score15, Points: 2, Cards: Cards{
Card{Face2, SuitSpades},
Card{Face3, SuitSpades},
Card{FaceKing, SuitClubs}}},
{Type: ScoreRun, Points: 4, Cards: Cards{
Card{Face2, SuitSpades},
Card{Face3, SuitSpades},
Card{Face4, SuitSpades},
Card{Face5, SuitSpades}}},
}},
{Card{Face8, SuitClubs},
testHandE, []ScoreResult{
{Type: Score15, Points: 2, Cards: Cards{
Card{Face7, SuitHearts},
Card{Face8, SuitHearts}}},
{Type: Score15, Points: 2, Cards: Cards{
Card{Face7, SuitHearts},
Card{Face8, SuitClubs}}},
{Type: ScorePair, Points: 2, Cards: Cards{
Card{Face8, SuitHearts},
Card{Face8, SuitClubs}}},
{Type: ScoreRun, Points: 4, Cards: Cards{
Card{Face7, SuitHearts},
Card{Face8, SuitHearts},
Card{Face9, SuitHearts},
Card{Face10, SuitHearts}}},
{Type: ScoreRun, Points: 4, Cards: Cards{
Card{Face7, SuitHearts},
Card{Face8, SuitClubs},
Card{Face9, SuitHearts},
Card{Face10, SuitHearts}}},
{Type: ScoreFlush, Points: 4, Cards: Cards{
Card{Face7, SuitHearts},
Card{Face8, SuitHearts},
Card{Face9, SuitHearts},
Card{Face10, SuitHearts}}},
}, []ScoreResult{
{Type: Score15, Points: 2, Cards: Cards{
Card{Face7, SuitHearts},
Card{Face8, SuitHearts}}},
{Type: Score15, Points: 2, Cards: Cards{
Card{Face7, SuitHearts},
Card{Face8, SuitClubs}}},
{Type: ScorePair, Points: 2, Cards: Cards{
Card{Face8, SuitHearts},
Card{Face8, SuitClubs}}},
{Type: ScoreRun, Points: 4, Cards: Cards{
Card{Face7, SuitHearts},
Card{Face8, SuitHearts},
Card{Face9, SuitHearts},
Card{Face10, SuitHearts}}},
{Type: ScoreRun, Points: 4, Cards: Cards{
Card{Face7, SuitHearts},
Card{Face8, SuitClubs},
Card{Face9, SuitHearts},
Card{Face10, SuitHearts}}},
}},
{Card{Face5, SuitSpades},
testHandK, []ScoreResult{
{Type: Score15, Points: 2, Cards: Cards{
Card{Face5, SuitHearts},
Card{FaceJack, SuitSpades}}},
{Type: Score15, Points: 2, Cards: Cards{
Card{Face5, SuitDiamonds},
Card{FaceJack, SuitSpades}}},
{Type: Score15, Points: 2, Cards: Cards{
Card{Face5, SuitClubs},
Card{FaceJack, SuitSpades}}},
{Type: Score15, Points: 2, Cards: Cards{
Card{Face5, SuitSpades},
Card{FaceJack, SuitSpades}}},
{Type: Score15, Points: 2, Cards: Cards{
Card{Face5, SuitHearts},
Card{Face5, SuitDiamonds},
Card{Face5, SuitClubs}}},
{Type: Score15, Points: 2, Cards: Cards{
Card{Face5, SuitHearts},
Card{Face5, SuitDiamonds},
Card{Face5, SuitSpades}}},
{Type: Score15, Points: 2, Cards: Cards{
Card{Face5, SuitHearts},
Card{Face5, SuitClubs},
Card{Face5, SuitSpades}}},
{Type: Score15, Points: 2, Cards: Cards{
Card{Face5, SuitDiamonds},
Card{Face5, SuitClubs},
Card{Face5, SuitSpades}}},
{Type: ScorePair, Points: 12, Cards: Cards{
Card{Face5, SuitHearts},
Card{Face5, SuitDiamonds},
Card{Face5, SuitClubs},
Card{Face5, SuitSpades}}},
{Type: ScoreNobs, Points: 1, Cards: Cards{
Card{FaceJack, SuitSpades}}},
}, []ScoreResult{
{Type: Score15, Points: 2, Cards: Cards{
Card{Face5, SuitHearts},
Card{FaceJack, SuitSpades}}},
{Type: Score15, Points: 2, Cards: Cards{
Card{Face5, SuitDiamonds},
Card{FaceJack, SuitSpades}}},
{Type: Score15, Points: 2, Cards: Cards{
Card{Face5, SuitClubs},
Card{FaceJack, SuitSpades}}},
{Type: Score15, Points: 2, Cards: Cards{
Card{Face5, SuitSpades},
Card{FaceJack, SuitSpades}}},
{Type: Score15, Points: 2, Cards: Cards{
Card{Face5, SuitHearts},
Card{Face5, SuitDiamonds},
Card{Face5, SuitClubs}}},
{Type: Score15, Points: 2, Cards: Cards{
Card{Face5, SuitHearts},
Card{Face5, SuitDiamonds},
Card{Face5, SuitSpades}}},
{Type: Score15, Points: 2, Cards: Cards{
Card{Face5, SuitHearts},
Card{Face5, SuitClubs},
Card{Face5, SuitSpades}}},
{Type: Score15, Points: 2, Cards: Cards{
Card{Face5, SuitDiamonds},
Card{Face5, SuitClubs},
Card{Face5, SuitSpades}}},
{Type: ScorePair, Points: 12, Cards: Cards{
Card{Face5, SuitHearts},
Card{Face5, SuitDiamonds},
Card{Face5, SuitClubs},
Card{Face5, SuitSpades}}},
{Type: ScoreNobs, Points: 1, Cards: Cards{
Card{FaceJack, SuitSpades}}},
}},
{Card{Face5, SuitSpades},
testHandM, []ScoreResult{
{Type: Score15, Points: 2, Cards: Cards{
Card{Face5, SuitHearts},
Card{FaceKing, SuitSpades}}},
{Type: Score15, Points: 2, Cards: Cards{
Card{Face5, SuitDiamonds},
Card{FaceKing, SuitSpades}}},
{Type: Score15, Points: 2, Cards: Cards{
Card{Face5, SuitClubs},
Card{FaceKing, SuitSpades}}},
{Type: Score15, Points: 2, Cards: Cards{
Card{Face5, SuitSpades},
Card{FaceKing, SuitSpades}}},
{Type: Score15, Points: 2, Cards: Cards{
Card{Face5, SuitHearts},
Card{Face5, SuitDiamonds},
Card{Face5, SuitClubs}}},
{Type: Score15, Points: 2, Cards: Cards{
Card{Face5, SuitHearts},
Card{Face5, SuitDiamonds},
Card{Face5, SuitSpades}}},
{Type: Score15, Points: 2, Cards: Cards{
Card{Face5, SuitHearts},
Card{Face5, SuitClubs},
Card{Face5, SuitSpades}}},
{Type: Score15, Points: 2, Cards: Cards{
Card{Face5, SuitDiamonds},
Card{Face5, SuitClubs},
Card{Face5, SuitSpades}}},
{Type: ScorePair, Points: 12, Cards: Cards{
Card{Face5, SuitHearts},
Card{Face5, SuitDiamonds},
Card{Face5, SuitClubs},
Card{Face5, SuitSpades}}},
}, []ScoreResult{
{Type: Score15, Points: 2, Cards: Cards{
Card{Face5, SuitHearts},
Card{FaceKing, SuitSpades}}},
{Type: Score15, Points: 2, Cards: Cards{
Card{Face5, SuitDiamonds},
Card{FaceKing, SuitSpades}}},
{Type: Score15, Points: 2, Cards: Cards{
Card{Face5, SuitClubs},
Card{FaceKing, SuitSpades}}},
{Type: Score15, Points: 2, Cards: Cards{
Card{Face5, SuitSpades},
Card{FaceKing, SuitSpades}}},
{Type: Score15, Points: 2, Cards: Cards{
Card{Face5, SuitHearts},
Card{Face5, SuitDiamonds},
Card{Face5, SuitClubs}}},
{Type: Score15, Points: 2, Cards: Cards{
Card{Face5, SuitHearts},
Card{Face5, SuitDiamonds},
Card{Face5, SuitSpades}}},
{Type: Score15, Points: 2, Cards: Cards{
Card{Face5, SuitHearts},
Card{Face5, SuitClubs},
Card{Face5, SuitSpades}}},
{Type: Score15, Points: 2, Cards: Cards{
Card{Face5, SuitDiamonds},
Card{Face5, SuitClubs},
Card{Face5, SuitSpades}}},
{Type: ScorePair, Points: 12, Cards: Cards{
Card{Face5, SuitHearts},
Card{Face5, SuitDiamonds},
Card{Face5, SuitClubs},
Card{Face5, SuitSpades}}},
}},
}
func TestScorePeg(t *testing.T) {

Loading…
Cancel
Save