Skip to content

Commit

Permalink
feature: added unit test for shuffling in place
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcello committed Jun 30, 2024
1 parent 9c1e24c commit 40a8511
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions deck_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ func Test_Shuffle(t *testing.T) {
}
}

func Test_ShuffleInPlace(t *testing.T) {
deck := New()
deck.Shuffle()

if reflect.DeepEqual(deck.Cards, New().Cards) {
t.Error("Should have shuffled the deck in place")
}
}

func Test_Draw_TooManyReturnsError(t *testing.T) {
deck := New()

Expand Down

0 comments on commit 40a8511

Please sign in to comment.