Closed akshitdewan closed 2 years ago
Is it possible to write a test for this, or is this part of the client untested so far?
I found https://github.com/okpy/ok-client/blob/master/tests/sources/common/interpreter_test.py, can a test be added there? (This logic feels like the sort of thing that could easily get bungled in the future)
I found https://github.com/okpy/ok-client/blob/master/tests/sources/common/interpreter_test.py, can a test be added there? (This logic feels like the sort of thing that could easily get bungled in the future)
agreed, added a few tests in pyconsole_test.py
(Should await Vanshaj's review too though)
lgtm, though i also think that code choice that pamela pointed out is a bit strange. non-blocking suggestion is to let the newline stay but to change the case assertions to account for it (but honestly that's also confusing so i don't think there's a winning alternative here).
I prefer having the right number of cases_total, otherwise the reader has to do an off-by-one calculation. I added a comment explaining the weird [1:]. I don't have merge permissions—could you merge it if it looks good?
earlier, when we had an infinite loop, we would not increment the total case count. As a result, when a student timed out on the second test case, the parsons tool would receive {passed: 1, total: 1} and incorrectly display that all test cases passed.