Insufficient test cases for "Resistor Color Expert"

I submitted code that passed all the existing tests but failed to correctly handle some actual resistor values in use in the E48 (2% tolerance) and larger series. There are currently no tests for 5-band resistors where the second band is black, which my earlier iteration handled wrongly.

Hi @xanni :wave:

Welcome to the Exercism forums!

Thanks for reporting this, and for starting a discussion here. I noticed your github issue last night and reopened it.

I’d welcome a test case or two, if you’d like to propose them and create a PR. :smile: This isn’t an exercise that pulls from problem-specifications, so it would be a matter of reviewing the test file on the Python track, and matching the style there to add new test cases.

You would then need to test the corresponding example.py file to make sure it passed the new cases (and change it if it does not pass the new cases).

Otherwise, I can add this to my list of things to do. It might take a little while, but i can address it.

Let me know either way. :smile:

I have added new tests, checked them against the example.py and created a PR: Update resistor_color_expert_test.py by xanni · Pull Request #3797 · exercism/python · GitHub

1 Like

Approved and merged! Thank you! :tada:

LMK if you want it marked “Hacktoberfest accepted”. :smile:

Sure why not! :slight_smile: Thanks.

Would it be fun to also add the requirement to handle three-band resistors which are 20% tolerance (the case where there is no tolerance band)?