cs50 / problems

Checks for check50
134 stars 227 forks source link

CS50P PSET1 Bank misses extra output #257

Closed ZRexshima closed 1 month ago

ZRexshima commented 2 months ago

If the tested program outputs the correct amount as a response but then prints out another line, check50 marks it as passing. In the example found, during manual testing the program printed:

$0 $None

This still apparently passes check50. So check50 searches a regex for that line but misses the extra line. My local test passed for 7/7 checks.

check50-part2

ZRexshima commented 2 months ago

Changing the return line of the regex function locally to the following seems to catch this and still passes my own solution code: return fr'^[^\d]*{escape(amount)}[^$\w]*$'

patrickthornton commented 1 month ago

fixed by https://github.com/cs50/problems/pull/263; used a different regex, but it achieves the same result you're going for!