Skip to content

A lenient way to match outputs #22

Open
@sudo-nan0-RaySK

Description

@sudo-nan0-RaySK

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghacktoberfestHacktoberfest 2020help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions