Skip to content

The test case for checking deadwood is wrong  #1

@dqt12hcmus

Description

@dqt12hcmus
func TestCheckDeadwood(t *testing.T) {
	hand := Hand{
		{2, "Clubs", "2"}, {2, "Diamonds", "2"}, {1, "Clubs", "A"},
		{4, "Hearts", "4"}, {3, "Diamonds", "3"}, {12, "Spades", "Q"},
		{3, "Spades", "3"}, {4, "Diamonds", "4"}, {7, "Hearts", "7"},
		{3, "Clubs", "3"},
	}

	unmelds := hand.CheckDeadwood()

	if reflect.DeepEqual(unmelds, []Deadwood{{
		{3, "Spades", "3"}, {4, "Hearts", "4"}, {7, "Hearts", "7"},
		{12, "Spades", "Q"}},
	}) {
		t.Error("Did not get the unmelded cards for the best meld.")
	}
	return
}

3 Spades should be in a meld [3 Diamond, 3 Spades, 3 Clubs]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions