Day 21: Part 2

Signed-off-by: James Griffin <james@unsupervised.ca>
This commit is contained in:
2020-12-22 11:58:18 -04:00
parent be72f3e8ce
commit 335ac758e2
3 changed files with 92 additions and 0 deletions

View File

@@ -28,3 +28,18 @@ func Test_combat_play(t *testing.T) {
t.Fail()
}
}
func Test_recursive_play(t *testing.T) {
c := combat{}
if err := c.load("sample.txt"); err != nil {
t.Logf(err.Error())
t.FailNow()
}
c.recursivePlay()
if c.one.score() != 0 || c.two.score() != 291 {
t.Logf("Expected score of 0-291, got %d-%d", c.one.score(), c.two.score())
t.Fail()
}
}