output_result.js 612 B

12345678910111213141516171819202122
  1. export function createNumberResult (expected, generated, grade) {
  2. return new OutputMatchResult(expected, generated, grade, "number");
  3. }
  4. export function createBoolResult (expected, generated, grade) {
  5. return new OutputMatchResult(expected, generated, grade, "bool");
  6. }
  7. export function createStringResult (expected, generated, grade) {
  8. return new OutputMatchResult(expected, generated, grade, "string");
  9. }
  10. export class OutputMatchResult {
  11. constructor (expected, generated, grade, type) {
  12. this.expected = expected;
  13. this.generated = generated;
  14. this.grade = grade;
  15. this.type = type;
  16. }
  17. }