I have reported a bug on an exercise (where I think the solution is wrong), but nowhere can I find where these are tracked. Is there a way I can see the progress? Otherwise it’s like a black box.
Can you point us to the report?
I don’t know where to find it. I reported through the editor’s Bug Report button, then there is no tracking anywhere.
In case you want to know which exercise, it is Elixir’s RPG Character Sheet.
The Report button on the UI is stored in an internal DB. I think it’s surfaced to track maintainers somehow, but I’m not sure how that works.
You could also provide details about what’s wrong for discussion/visibility on the forum!
Well, Test 10 of the exercise seem to check IO output incorrectly. There are lots of prompts generated from gets
, but the assertion do not include those. I cannot hack an answer either because Test 8 do assert the prompts.
You mean the D&D Character
exercise?
The 10th test I see in the test file is:
test "for score 12 is +1" do
assert modifier(12) === 1
end
I don’t see any gets
or prompts in that exercise.
It’s also worth noting that nearly 400 people have published solutions for the exercise so they all managed to write code which passes the tests. Is it possible there’s something about the exercise you’ve misunderstood?
Not that exercise, this one: RPG Character Sheet in Elixir on Exercism
I can’t see community solutions because it is locked.
Test 8 asserts:
io = capture_io("Susan The Fearless\nfighter\n6\n", fn -> RPG.CharacterSheet.run() end)
assert io =~
"Welcome! Let's fill out your character sheet together.\nWhat is your character's name?\nWhat is your character's class?\nWhat is your character's level?\n"
While Test 10 asserts:
io = capture_io("Anne\nhealer\n4\n", fn -> RPG.CharacterSheet.run() end)
assert io =~ "\nYour character: " <> inspect(%{name: "Anne", class: "healer", level: 4})
Which fails with:
1) test run/0 it inspects the character map (RPG.CharacterSheetTest)
test/rpg/character_sheet_test.exs:117
Assertion with =~ failed
code: assert io =~ "\nYour character: " <> inspect(%{name: "Anne", class: "healer", level: 4})
left: "Welcome! Let's fill out your character sheet together.\nWhat is your character's name?\nWhat is your character's class?\nWhat is your character's level?\nYour character:: %{class: \"healer\", level: 4, name: \"Anne\"}\n"
right: "\nYour character: %{class: \"healer\", level: 4, name: \"Anne\"}"
stacktrace:
test/rpg/character_sheet_test.exs:126: (test)
As you see, test 10 assertion doesn’t include the prompts.
Test 10 is expecting you to use the IO.inspect()
function with the :label
option.
Did the hints point you in this direction?
I do use it, which is exactly why I am asking here.
See. the assertion in test 8 includes the welcome message and the three prompt. Test 10 should also include these, but it doesn’t. It checks only for the IO.inspect
, which I do, but it fails the test because the prompts are not included in the assertion.
The test is assert io =~ """ some text """
The =~/2 function is not an equality check: when the right-hand operand is a string:
returns
true
ifleft
containsright
.
Looking closer at the test result you posted:
left: "Welcome!...\nYour character:: %{class: \"healer\", level: 4, name: \"Anne\"}\n"
right: "\nYour character: %{class: \"healer\", level: 4, name: \"Anne\"}"
The :label
option adds a colon for you. I’m sure I tripped over this as well.
Oh wow that really requires a 20 on a Spot check. Thank you!