extends GutTest

func test_deck_has_108_cards():
    var deck := Deck.create()
    assert_eq(deck.remaining(), 108)

func test_deal_reduces_count():
    var deck := Deck.create()
    var cards := deck.deal(27)
    assert_eq(cards.size(), 27)
    assert_eq(deck.remaining(), 81)

func test_shuffle_deterministic():
    var seed := 12345
    var deck1 := Deck.create(seed)
    var deck2 := Deck.create(seed)
    var hand1 := deck1.deal(108)
    var hand2 := deck2.deal(108)
    for i in range(108):
        assert_eq(hand1[i].card_id, hand2[i].card_id)

func test_deal_empty_deck():
    var deck := Deck.create()
    deck.deal(108)
    var extra := deck.deal(1)
    assert_eq(extra.size(), 0)

func test_deck_card_ids_unique():
    var deck := Deck.create()
    var all_cards := deck.deal(108)
    var ids := {}
    for c in all_cards:
        assert_false(ids.has(c.card_id))
        ids[c.card_id] = true
    assert_eq(ids.size(), 108)
