exercism / c-test-runner

GNU Affero General Public License v3.0
5 stars 5 forks source link

Allow whitespace before test function handle #53

Closed wolf99 closed 2 years ago

wolf99 commented 2 years ago

Should fix the issue mentioned here: https://github.com/exercism/c/issues/736#issuecomment-997277045

Can try it out here: https://regex101.com/r/7DdrGe/1

I'm not sure why the existing leading \n\s* is needed. Anyone know?

arcuru commented 2 years ago

I'm not sure why the existing leading \n\s* is needed. Anyone know?

It doesn't look necessary to me. It's trying to match that full line of text, but it's just one more thing that might breaking if the formatting changes.

wolf99 commented 2 years ago

Ah, the failure for multiple_tests_with_all_pass_and_last_commented_out would be what the leading \n\s* is for! Seems like ^\s* would be better? But I am not very knowledgeable on regex

EDIT: I tried ^\s* but it failed with some kind of overflow errors in the python script. Reverting to the leading \n\s* works so I will leave that part as I found it.