problem-specifications icon indicating copy to clipboard operation
problem-specifications copied to clipboard

Clock: add and subtract expect a string, not a Clock

Open IsaacG opened this issue 3 years ago • 2 comments

The add and subtract methods in the Clock test data have expected results which are strings. In Python, this translates to allowing solutions to return a string and not a Clock. I'm not sure how this manifests in other languages.

How burdensome would it be to change the expected results to be a clock instead? Would that be valid canonically (ie across tracks)?

IsaacG avatar Apr 16 '22 17:04 IsaacG

On the Julia track we expect objects but also have tests for the string representation of those objects.

How burdensome would it be to change the expected results to be a clock instead? Would that be valid canonically (ie across tracks)?

One would either have to duplicate or reimplement every single test case.


I don't think this change would be worth it. The canonical data isn't student-facing, it exists for the maintainers. They can choose how to interpret it and can convert between strings and objects however they like. Even a generator could trivially deal with this translation.

SaschaMann avatar Apr 16 '22 17:04 SaschaMann

I don't think this change would be worth it. The canonical data isn't student-facing, it exists for the maintainers. They can choose how to interpret it and can convert between strings and objects however they like. Even a generator could trivially deal with this translation.

Agreed. A track is free to have the implementation compare objects instead of strings.

ErikSchierboom avatar Apr 19 '22 08:04 ErikSchierboom