Closed junedev closed 3 years ago
Another example is Gross Store "TestRemoveItem/Invalid_measurement_unit".
My feeling this happens when the test table does not start immediately below the t.Run
. In the cases I saw so far there was always a struct definition between t.Run and the table. This seems to trip up the test runner when it tries to extract the table.
That means we have to options: Fix the tests to not use this struct (e.g. use an anonymous nested struct instead) or fix the test runner so that it can handle the struct correctly.
Since I know my way around the test runner now, I will try to fix this as well.
The README of the test runner says that if you conform to a certain structure, the code that is shown on the website for a certain sub test only includes the parts that are relevant for that subtest. See https://github.com/exercism/go-test-runner#subtest-format-specification
However, there seem to be quite a lot of cases where the code seemingly conforms to the specification given in the README but the subtests show the whole test table on the website which is confusing for the students.
Here is one example, I will try to add more later on.
This is
TestFirstTurn
from the BlackJack exercise: https://github.com/exercism/go/blob/b8cccc8969db842b591f762e5426381a64880adc/exercises/concept/blackjack/blackjack_test.go#L175-L385On the website the FirstTurn subtest code contains the full table of test cases (it is the same no matter whether the test failed or passed):