Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A lenient way to match outputs #22

Open
sudo-nan0-RaySK opened this issue Sep 30, 2020 · 0 comments · Fixed by #42
Open

A lenient way to match outputs #22

sudo-nan0-RaySK opened this issue Sep 30, 2020 · 0 comments · Fixed by #42
Labels
bug Something isn't working hacktoberfest Hacktoberfest 2020 help wanted Extra attention is needed

Comments

@sudo-nan0-RaySK
Copy link

sudo-nan0-RaySK commented Sep 30, 2020

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.
@alias-rahil alias-rahil added enhancement New feature or request hacktoberfest Hacktoberfest 2020 help wanted Extra attention is needed bug Something isn't working and removed enhancement New feature or request labels Sep 30, 2020
@roerohan roerohan linked a pull request Oct 4, 2020 that will close this issue
@roerohan roerohan reopened this Oct 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working hacktoberfest Hacktoberfest 2020 help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants