Add `-n` test to reverse-string ?
Given that the builtin echo command cannot output the string "-n" (ref Why is printf better than echo?), we could amp up the difficulty of reverse-string by adding another diabolical test:
@test "echo -n" {
[[ $BATS_RUN_SKIPPED == "true" ]] || skip
run bash reverse_string.sh 'n-'
assert_success
assert_output -- '-n'
}
This will force the student to learn about a fairly nasty echo edge case.
On the other hand, reverse-string is currently an easy exercise with difficulty 1, and adding this test is likely to break a large proportion of existing solutions.
Printing -n is a fun challenge, but it's not especially relevant to this exercise. In theory, that could be tacked onto any other exercise that allows arbitrary strings as the output. I would suggest passing.
We could bring this up in an automated feedback, rather than driving it through tests.