exercism / scala

Exercism exercises in Scala.
https://exercism.org/tracks/scala
MIT License
123 stars 131 forks source link

Fixed Unit Test, missing empty string for first test case #709

Closed brownbonnie closed 2 years ago

brownbonnie commented 2 years ago

I've added a small fix to get the unit tests into a compiling state.

brownbonnie commented 2 years ago

I've raised this in an issue also: https://github.com/exercism/scala/issues/708

ErikSchierboom commented 2 years ago

This is not actually a bug, but a feature :) The goal of this exercise is to have students use optional parameters with a default value. Hence the test without a name being passed.

brownbonnie commented 2 years ago

Ah very interesting, thanks. Would it be possible to add examples of default parameters in the tutorial?

mrybak834 commented 1 month ago

Hello,

I would argue that a test not compiling is not a result of the failure of the one trying to solve the question.

The tests are supposed to be units of truth outside of the structure of the solution program. Having a test not compile is not the same as it failing, per test driven development. All tests should compile, in order to verify the solution program.

It's a neat thing to consider (passing in defaults), but I don't think it makes sense for a test to not compile like it does here. At the very least it should be mentioned somewhere as it is creating confusion and looks like a bug.

Thanks!

https://github.com/exercism/scala/issues/708

brownbonnie commented 1 month ago

@mrybak834 That's a really good point!

ErikSchierboom commented 1 month ago

The ergonomics here are a bit odd. It might be better to convert the exercise to use an Option[T] parameter instead.