Go exercise "elons-toys" test case does not cover edge case

Just before the contribution policy change, I’ve created a test that should cover an edge case which a great portion of the community solutions do not cover.
Link to original PR: here
By accident, I’ve chosen a battery and trackDistance combination that actually does not trigger the wrong behavior. I wanted to fix this test case in a new PR, but this is not possible anymore.

This issue would be fixed with the following test:

{
    name: "Car has 60% battery. Car cannot finish the race",
    car: Car{
        speed:        3,
        batteryDrain: 3,
        battery:      60,
    },
    trackDistance: 61,
    expected:      false,
},

instead of this one:

{
    name: "Car has 50% battery. Car cannot finish the race",
    car: Car{
        speed:        3,
        batteryDrain: 3,
        battery:      50,
    },
    trackDistance: 51,
    expected:      false,
},

Fix has been merged but I don’t how marking this conversation as “solved” works.

1 Like

I was able to mark your reply as solution.
Thank you so much! I just wanted to make sure other people solving this exercise don’t make the same error as I did. Now it works for sure! :partying_face:

3 Likes