generate_repr: Add doctests

... and remove then obsolete test cases in the according test file.