amnaredo / test

0 stars 0 forks source link

pprint (derivation) tests are not as strict as they could be #140

Open amnaredo opened 2 years ago

amnaredo commented 2 years ago

Because they test only that pprint is as good as calling toString which however could mean that derivation did directly go into fallback mode. It would make sense to override printing of one of the leaf types of the structures tested (like Int or String) and then check if derivation manages to go into the structure.

An alternative would be to switch off the fallback for the test (How would you do that? Maybe by providing an alternative implicit macro with the fallback disabled.)

ID: 105 Original Author: jrudolph

amnaredo commented 2 years ago

This isn't true, pprint in most cases does not return the same string as toString. Commas have a space after them, strings are quoted, etc. I don't think this is really an issue issue, feel free to submit a patch if you think it's worth your time to twiddle them stricter

Original Author: lihaoyi