Skip to content

Instantly share code, notes, and snippets.

@harms
Created May 16, 2013 11:53
Show Gist options
  • Save harms/5591224 to your computer and use it in GitHub Desktop.
Save harms/5591224 to your computer and use it in GitHub Desktop.
Example tests, applicable of 'isAceLowStraight'. Works in context of programs found at http://www.jsoftware.com/jwiki/TracyHarms/PokerHandsScoring
prep=: ranks @: makeHand
assert -. isAceLowStraight prep '6 D 4 H 3 C 2 S A C'
assert -. isAceLowStraight prep '6 H 5 D 4 H 3 C 2 S'
assert isAceLowStraight prep '5 D 4 H 3 C 2 S A C'
assert isAceLowStraight prep '5 D 4 D 3 D 2 D A D'
@harms
Copy link
Author

harms commented May 18, 2013

I am dissatisfied with the pairs, two checks on negative cases and two on positive. These alternatives suggest that there are meaningful differences in the test cases. I could not defend the claim that there are such differences. Perhaps their variety is of some value, but I can't formalize such value. Instead, I am inclined to say that having extra tests is a distraction that reduces clarity. -- Tracy Harms (author)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment