List Ops: proposal for another Reverse case

I’m mentoring a List Ops solution in Go. The solution has some bugs that are not caught by the tests. I’d like to propose another test case for reverse that (1) introduces an odd-sized list and (2) is a bit longer.

Proposed case:

        {
          "uuid": "...",
          "description": "non-empty odd-length",
          "property": "reverse",
          "input": {
            "list": [1, 3, 5, 7, 9, 11, 13]
          },
          "expected": [13, 11, 9, 7, 5, 3, 1]
        },
1 Like

+1 from me.

Seems reasonable. What’s the general issue we’re trying to catch?

This would help with the in-place swap approach to reversing with bad boundary checks (off by one).

1 Like

+1 from me. Dunno how relevant it is to Python - but we’re redoing that exercise anyways, so.

Oh yeah, that’s an +1 for me. That’s the usual three-maintainer sign off on a PR, but let’s give it a couple of days for other feedback just in case.

I created a PR.

Please do not merge the PR. I plan on merging it no sooner than Sept 25.

1 Like