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.

Activity

added
enhancementNew feature or request
help wantedExtra attention is needed
bugSomething isn't working
and removed
enhancementNew feature or request
on Sep 30, 2020
linked a pull request that will close this issuefeat: Trim each line before matching output #42on Oct 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

      Participants

      @sudo-nan0-RaySK@roerohan@alias-rahil

      Issue actions

        A lenient way to match outputs · Issue #22 · csivitu/code-executor