-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[Clock] Proposal for additional tests #2926
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This comment was marked as resolved.
This comment was marked as resolved.
Hi @astrieanna 👋🏽 Apologies for the email spam -- there was something funky with my GH interface, and this message posted while I was still writing it. Nuked the first half of my message. 😱 Thank you so much for filing this issue - and I would be thrilled if you wanted to PR additional tests for the Let's take these point-by-point:
🌟 You are correct. We'd add these proposed tests in the
🤔 Yeah. That does sound like its a new (or at least slightly more complex) test type. No worries -- what I usually do (since I am by no means a JinJa expert) is :
So ... forgive me if I am mis-interpreting here. I see two things:
Just let me know what I can do to help. I think the tests you propose would be super-helpful, and really support the addendums we've included in this exercise - so I'd love to see them happen. 😄 |
@astrieanna -- just a friendly ping! Are you still interested in working this? Just let me know...thanks! |
Hi @astrieanna -- as noted in #3008, this exercise now has over 100 test cases. It feels like we should take a pause and figure out how to pare that down and then maybe add some cases as proposed here. To that end, I am going to close this issue for now, with the thought that we'd maybe revisit this entire exercise in a few months to see where we're at, and what we want to do. I'll log a "tracking issue" meanwhile. Let me know if you have any questions or issues. |
I was mentoring a friend who solved the problem in a way that surprised me: his
__repr__
implementation always returned the values the clock was initially constructed with. Regardless of how you mutated the clock, his__repr__
would stay the same. Since this incorrect solution passed all existing tests, I'd like to add a couple more tests.Since the tests for
__repr__
are inpractice/clock/.meta/additional_tests.json
, I'm assuming this repo is the right place to add some additional tests.From looking at how the tests are generated, I'm not sure what the easiest approach would be. The way the current
repr
type tests are setup makes it easy to add "create a Clock, immediately call__repr__
" tests, but adding a couple of tests that add/subtract before calling__repr__
would probably require a new type of test? (since it would need different treatment by the Jinja template).I was also thinking about adding tests of
__repr__
in addition to__str__
to theadd
andsubtract
tests (since those tests are why__str__
has to update), but that would require the Jinja template to reformat eachhh:mm
string from upstream intoClock(hh,mm)
while removing the leading zeros. I'm not really familiar with Jinja, so that seems like it might be complicated to template correctly.I'm happy to make a PR, but I'd like input first on how they should be added. :)
The text was updated successfully, but these errors were encountered: