Commit 8d8016dd authored by Ari Trachtenberg's avatar Ari Trachtenberg
Browse files

Fixed up testing

parent 48cde00e
Loading
Loading
Loading
Loading
+27 −18
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ bool test_labOne_pOne() {
    // example 1
    Common::redirIO("2");
    labOne_pOne();
    int out = stoi(Common::restoreIO());
    int out = Common::getInt(Common::restoreIO());
    if (out!=5)
        return false;

@@ -67,6 +67,11 @@ bool test_labOne_pTwo() {
  string line;
  int sum = 0;
  while (getline(stream, line)) {
    // ignore lines that have "Input:" or "Output:"
    if (
        (line.find("Input:") == string::npos)
            && (line.find("Output:") == string::npos)
        )
      sum += line.length();
  }

@@ -86,7 +91,11 @@ bool test_labOne_pThree() {
    string line;
    int sum = 0;
    while (getline(stream, line)) {
        sum += stoi(line);
      if (
          (line.find("Input:") == string::npos)
              && (line.find("Output:") == string::npos)
          )
        sum += Common::getInt(line);
    }

    if (sum==132)