Beta
Browser History Sorting
14XD1amond
Loading description...
Sorting
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
Description does not restrict the range of dates in
history
. Technically they can be further thancurrent
(for example, if users change their system clock), and in this case it's undefined how they should be handled.Resolved
Random tests pass in strings in
current
instead of datetime, which is inconsistent to the sample tests.Sample tests do not have a test case that demonstrates value besides
This Year
andPast a Year
. Random tests only sometimes go up toThis Month
. The test coverage is inadequate.A related issue: there should be fixed tests in actual test code too. It should be a superset of the sample tests.
Resolved
Resolved
date
to represent, well, dates. Is there a reason to use strings to represent dates?I believe in my most recent edit I cleared up the time period definitions.
I thought that it was good practice to put inputs in titles so people could figure out if they are failing on particular edge cases, I know that has helped me in the past, otherwise what would be your suggestion for test titles?
I will also fix the dates tomorrow and mathing up sample and submission tests, I fixed it but it came back up again.
Presenting inputs is (almost) always a good thing, I fully agree. But there is more than one way to present them, not just with titles of
@it
. I will try to prepare examples for you with two other possibilities: all random tests collapsed to a single@it
and presenting inputs euther with an assertion message, or with special type of output tabs supported by CW test panel. You will judge which approach you like the most.Fixed all except the testing titles, still a little bit confused on those.
Here you have example of assertion messages instead of titles: https://www.codewars.com/kumite/66c513932287786e6a8486a6?sel=66c513932287786e6a8486a6 (it's just an example, you can work on improvements to the formatting if you want).
Here is an example of feedback with tab panels: https://www.codewars.com/kumite/66c513932287786e6a8486a6?sel=66c516d4d3f71cbc8ec3b725 (again, just an example, you'd have to work out the details of presentation of dicts vs lists etc.)
Thats awesome, thanks for taking the time to explain and code that up. I started implementing and formatting it today but will have to finish tomorrow because I do not want to publish a half tab half messy assertion. For some reason whenever I try to do \n in the logging it makes a new log space instead of a new line. Any insight? Thanks again.
I would have to see to know exactly, but you can try using
<:LF:>
marker insteaf of\n
newline.After lots of tweaking and tuning, I got a unittest format that I'm happy with, please take a look at it and give it some feedback when you get the chance. The marker instead of newline worked, so thanks for that.
I think presentation is not bad now. What still could be improved is that tests crash badly when the solution gets types wrong, and returns a list instead of dict or vice versa, or
None
(which can happen when some branch in the logic is missing and the execution falls out of the function, implicitly returningNone
), or some other value of unexpected type. I would recommend making an assertion on the type before attempting to format theactual
(but still presentinghistory
andexpected
as formatted).Implemented.
Sample tests and submission tests are using different types for
current
.I believe this is resolved
This comment has been hidden.
This comment has been hidden.
https://www.codewars.com/kata/reviews/66c39cdb7e75e9a98a95b2fe/groups/66c3a298f2c0a2b9d828dfbb
Resolved by using tuples instead of list as history input.
The history list should be a list (and the user function should receive a copy).