Beta

Browser History Sorting

Description
Loading description...
Sorting
  • Please sign in or sign up to leave a comment.
  • Voile Avatar

    Description does not restrict the range of dates in history. Technically they can be further than current (for example, if users change their system clock), and in this case it's undefined how they should be handled.

  • Voile Avatar

    Random tests pass in strings in current instead of datetime, which is inconsistent to the sample tests.

    If sorted by date/time, return a dictionary containing keys that are "Today", "Yesterday", "This Week", "This Month", "This Year", and "Past a Year" (if there are entries within these time periods) and corresponding values that contain a list of entries within these time periods (sorted by date and time)

    Sample tests do not have a test case that demonstrates value besides This Year and Past a Year. Random tests only sometimes go up to This 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.

  • mauro-1 Avatar
    • Python: function name should be snake_case
    • "00:00" with no leading zeros for the hour but many times have leading zeroes.
  • hobovsky Avatar
    • Make sure that definitions of "this week", "this month", and "this year" are clear and unambiguous. For example, the "this month" expects to have entries from July, even though this month is August.
    • Reconsider placing inputs in titles of tests. It is usually OK when inputs are small and easy to present, but in this challenge, they can be quite bulky. It would be good to at least check how tests would work if inputs were presented with failure messages, or maybe with tabbed log panels.
    • Consider using date to represent, well, dates. Is there a reason to use strings to represent dates?
    • XD1amond Avatar

      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.

    • hobovsky Avatar

      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.

    • XD1amond Avatar

      Fixed all except the testing titles, still a little bit confused on those.

    • hobovsky Avatar

      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.)

    • XD1amond Avatar

      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.

    • hobovsky Avatar

      I would have to see to know exactly, but you can try using <:LF:> marker insteaf of \n newline.

    • XD1amond Avatar

      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.

      Suggestion marked resolved by XD1amond 7 months ago
    • hobovsky Avatar

      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 returning None), or some other value of unexpected type. I would recommend making an assertion on the type before attempting to format the actual (but still presenting history and expected as formatted).

    • XD1amond Avatar

      Implemented.

  • scarecrw Avatar

    Sample tests and submission tests are using different types for current.

  • XD1amond Avatar

    This comment has been hidden.

  • Fbasham Avatar