Skip to content

off-by-1 error in TestFixBirdCount of bird_watcher_test (or problem description). #2833

@jrpilat

Description

@jrpilat

The description for Problem 3 of the Bird Watcher go exercise states,

You realized that all the time you were trying to keep track of the birds, there was one bird that was hiding in a far corner of the garden.

You figured out that this bird always spent every second day in your garden.

This means that the 1st day, the bird was not in the garden, the 2nd day it was, the 3rd day it was not, the 4th day it was, and so on and so forth.

bird_watcher_test, however, is coded to test something different: It expects that the 1st day, the bird was in the garden, the 2nd day it was not, the 3rd day it was, the 4th day it was not:
https://github.com/exercism/go/blob/main/exercises/concept/bird-watcher/bird_watcher_test.go

Thus, either the problem description or the test is off by 1. I'm not sure which of the 2 y'all prefer to change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions