RedPanda-CPP/RedPandaIDE/problems/problemcasevalidator.cpp

23 lines
532 B
C++
Raw Normal View History

2021-11-01 22:33:16 +08:00
#include "problemcasevalidator.h"
#include "../utils.h"
ProblemCaseValidator::ProblemCaseValidator()
{
}
bool ProblemCaseValidator::validate(POJProblemCase problemCase)
{
if (!problemCase)
return false;
QStringList output = TextToLines(problemCase->output);
QStringList expected = TextToLines(problemCase->expected);
if (output.count()!=expected.count())
return false;
for (int i=0;i<output.count();i++) {
if (output[i]!=expected[i])
return false;
}
return true;
}