Expenses exercise - last function error string with category name

Hi,

In the Expenses exercise, the last function to implement display an example of the error message containing the missing category name:

// => 0, error(unknown category entertainment) 

The test suite is not validating the content of the error message at all, only that an error is return (!= nil). I would suggest to either change the test suite to validate the content of the message or change the instruction to not output the category name.

For the 1st option, I already did a PR to add this more detailed test:

I understand that making the test validate the error string will make most of existing solutions to fail. So, I do not know what approach you usually take for such a case.

Hi @marcaurele,

thanks for pointing this out! In concept exercises, we focus very much on teaching a single concept and support that with tests. This exercise has a document, showing the intended focus: First class functions.

So I think testing for specific error messages is distracting from the learning objective and should not be done here.

PS: I am no Go track maintainer, and have no opinion about testing for error messages in practice exercises on the Go track.

I understand that, even more after discovering how the exercises are maintained and should apply to many programming language tracks.

+cc @andrerfcsantos

For me the PR does not need to be re-opened / merged. I understand that it’s not the intend of the assignments in general to go in such a detail.