Go track, Exercises -> Vehicle Purchases (strange test 6)

In this task, I could not pass the 6th test, because I do not understand why it should output a string in the answer, whereas I should output boolean (link: Exercism)

Test 6
TestChooseVehicle/ chooses Bugatti over Ford

2. Choose between two potential vehicles to buy

You evaluate your options of available vehicles. You manage to narrow it down to two options but you need help making the final decision. For that, implement the function ChooseVehicle(option1, option2) that takes two vehicles as arguments and returns a decision that includes the option that comes first in lexicographical order.

vehicle := ChooseVehicle("Wuling Hongguang", "Toyota Corolla")
// => "Toyota Corolla is clearly the better choice."

ChooseVehicle("Volkswagen Beetle", "Volkswagen Golf")
// => "Volkswagen Beetle is clearly the better choice."

The exercise pretty specifically says you should output a string. Why do you think it should return a boolean?

Note: In general, one of the best ways to get help is to submit your code using the CLI then requesting mentoring. That allows someone familiar with the language and exercise to see both your code and the test outputs. That makes it much easier for them to help guide you towards a solution.

1 Like

I have noticed where my mistake. Thanks!