elixir
elixir copied to clipboard
RPN Calculator: two additional test cases so that a naïve implementation cannot pass the test suite
Got a student whose implementation of this exercise was passing all tests, but was not actually using the result of operation.(stack)
at any time. Instead, it was manually returning :ok
and {:ok, "operation completed"}
.
This was passing the test suite because only one operation
was being used as test case for either calculate!/2
, calculate/2
and calculate_verbose/2
. Simply adding another test case that uses a different operation
function should prevent such naïve implementation from passing all the tests.
Thank you for contributing to exercism/elixir
💜 🎉. This is an automated PR comment 🤖 for the maintainers of this repository that helps with the PR review process. You can safely ignore it and wait for a maintainer to review your changes.
Based on the files changed in this PR, it would be good to pay attention to the following details when reviewing the PR:
-
General steps
- 🏆 Does this PR need to receive a label with a reputation modifier (
x:size/{tiny,small,medium,large,massive}
)? (A medium reputation amount is awarded by default, see docs)
- 🏆 Does this PR need to receive a label with a reputation modifier (
-
Any exercise changed
- 👤 Does the author of the PR need to be added as an author or contributor in
<exercise>/.meta/config.json
(see docs)? - 🔬 Do the analyzer and the analyzer comments exist for this exercise? Do they need to be changed?
- 📜 Does the design file (
<exercise>/.meta/design.md
) need to be updated to document new implementation decisions?
- 👤 Does the author of the PR need to be added as an author or contributor in
-
Concept exercise changed
- 🌲 Do
prerequisites
andpractices
inconfig.json
need to be updated? - 📖 Does the concept introduction provide all necessary information to solve this exercise?
- 🌲 Do
-
Concept exercise tests changed
- ⚪️ Are all tests un-skipped?
- 🔢 Are all tests annotated with
@tag task_id
? - 🐈 Can all tests be understood by reading the test's block only (e.g. no module attributes, no setup functions)?
Automated comment created by PR Commenter 🤖.
... was not actually using the result of
operation.(stack)
at any time. Instead, it was manually returning:ok
and{:ok, "operation completed"}
.
Test-driven development at its most pure! ;)