code_test.go 413 B

12345678910111213141516171819202122232425
  1. package main
  2. import "testing"
  3. func TestPart1(t *testing.T) {
  4. fish := readInput("./testinput")
  5. if len(fish) == 0 {
  6. t.Error("Could not read input")
  7. }
  8. if breed(fish, 80) != 5934 {
  9. t.Error("Part 1 failed")
  10. }
  11. }
  12. func TestPart2(t *testing.T) {
  13. fish := readInput("./testinput")
  14. if len(fish) == 0 {
  15. t.Error("Could not read input")
  16. }
  17. if breed(fish, 256) != 26984457539 {
  18. t.Error("Part 2 failed")
  19. }
  20. }