<commit_before>package blackjack

import (
	. "github.com/dohodges/fifty2"
	"testing"
)

func TestHandValues(t *testing.T) {

	assertHandValue(t, 4, []Card{
		Card{Two, Clubs},
		Card{Two, Diamonds},
	})

	assertHandValue(t, 12, []Card{
		Card{Ace, Spades},
		Card{Ace, Hearts},
	})

	assertHandValue(t, 13, []Card{
		Card{Ace, Spades},
		Card{Ace, Hearts},
		Card{Ace, Clubs},
	})

	assertHandValue(t, 14, []Card{
		Card{Ace, Spades},
		Card{Ace, Hearts},
		Card{Ace, Clubs},
		Card{Ace, Diamonds},
	})

	assertHandValue(t, 20, []Card{
		Card{Queen, Spades},
		Card{Ten, Clubs},
	})

	assertHandValue(t, 21, []Card{
		Card{Jack, Spades},
		Card{Ace, Hearts},
	})

	assertHandValue(t, 21, []Card{
		Card{Queen, Hearts},
		Card{Jack, Spades},
		Card{Ace, Hearts},
	})

	assertHandValue(t, 21, []Card{
		Card{Two, Hearts},
		Card{Four, Spades},
		Card{Nine, Hearts},
		Card{Three, Hearts},
		Card{Three, Diamonds},
	})

	assertHandValue(t, 29, []Card{
		Card{Queen, Hearts},
		Card{Jack, Spades},
		Card{Nine, Hearts},
	})

}

func assertHandValue(t *testing.T, expect uint, hand []Card) {
	if value := HandValue(hand); value != expect {
		t.Errorf("hand %v value %v != %v", String(hand), value, expect)
	}
}<commit_msg>fix blackjack test<commit_after>package blackjack

import (
	. "github.com/dohodges/fifty2"
	"testing"
)

func TestHandValues(t *testing.T) {

	assertHandValue(t, 4, []Card{
		Card{Two, Clubs},
		Card{Two, Diamonds},
	})

	assertHandValue(t, 12, []Card{
		Card{Ace, Spades},
		Card{Ace, Hearts},
	})

	assertHandValue(t, 13, []Card{
		Card{Ace, Spades},
		Card{Ace, Hearts},
		Card{Ace, Clubs},
	})

	assertHandValue(t, 14, []Card{
		Card{Ace, Spades},
		Card{Ace, Hearts},
		Card{Ace, Clubs},
		Card{Ace, Diamonds},
	})

	assertHandValue(t, 20, []Card{
		Card{Queen, Spades},
		Card{Ten, Clubs},
	})

	assertHandValue(t, 21, []Card{
		Card{Jack, Spades},
		Card{Ace, Hearts},
	})

	assertHandValue(t, 21, []Card{
		Card{Queen, Hearts},
		Card{Jack, Spades},
		Card{Ace, Hearts},
	})

	assertHandValue(t, 21, []Card{
		Card{Two, Hearts},
		Card{Four, Spades},
		Card{Nine, Hearts},
		Card{Three, Hearts},
		Card{Three, Diamonds},
	})

	assertHandValue(t, 29, []Card{
		Card{Queen, Hearts},
		Card{Jack, Spades},
		Card{Nine, Hearts},
	})

}

func assertHandValue(t *testing.T, expect uint, hand []Card) {
	if value := HandValue(hand); value != expect {
		t.Errorf("hand %v value %v != %v", hand, value, expect)
	}
}
{'fraction_non_alphanumeric': 0.187422934648582, 'fraction_numerical': 0.014796547472256474, 'mean_word_length': 4.420935412026726, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3279242', 'n_tokens_mistral': 1138, 'n_tokens_neox': 1022, 'n_words': 216}