Hello, uiua people! I am just starting my uiua journey, exciting.
I’m doing the exercises in the online environment.
For the first “Hello world” exercise, there seems to be a bug, because the tests pass for any string (including the original unmodified code).
I don’t know Uiua, but I was able to replicate this issue. The REPL indicates that the assert would fail on the starting code as expected. I suspect there might be a problem further along like when the results get reported by the test runner.
Hello ← |0 "Goodbye, Mars!"
Hello ← |0 "Goodbye, Mars!"
⍤⤙≍ "Hello, World!" Hello
⍤⤙≍ "Hello, World!" Hello
Error: Goodbye, Mars!
at 1:1
1 | ⍤⤙≍ "Hello, World!" Hello
─
Sounds like the test is too loose—it’s passing any string, which isn’t right. try restarting the session or check if the test logic has a bug. if it keeps happening, flag it with Exercism support.
I did some testing, and this seems to be a bug in the Uiua language itself, which is that a file containing only a single test will not be tested.
The bug has been reported, so there are two ways this could be resolved now.
a. Wait until the bug is fixed and the test runner has been updated to a Uiua version with the fix (probably 0.18.0 in a month or two).
b. Wrapping the test in a test module like this:
┌─╴test
⍤⤙≍ "Hello, World!" Hello
└─╴
fixes the bug. I could open a PR for this.
Are there any obvious ramifications or gotchas for using a test module? The maintainers may want to remain consistent across all exercises and add the test module there as well.
Not as far as I know. The only documented difference is the behavior of assertions when run with the uiua run command, which isn’t relevant to Exercism’s test runner, or students running the tests locally with uiua test.