Open
Description
Right now, comparison is as simple as :
remarks = expectedOutput === obtainedOutput ? 'Pass' : 'Fail';
It should be more tolerant to outputs where there can be an extra space, a carriage return etc.
Alternatively, best way to do this is by serializing the return value and then compare these serialized objects instead of strings. This has a lot of benefits:
- Data structures can be returned as a result of procedure calls, instead of providing a specific output format for each problem.
- Sometimes people interpret non printable characters in a wrong way (different from intended). This solves that problem so that users never get a penalty just because they counted one space less or more.