Skip to content

Commit

Permalink
fix error
Browse files Browse the repository at this point in the history
  • Loading branch information
issacto committed Jun 23, 2023
1 parent beaf753 commit 9c1b67d
Showing 1 changed file with 13 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ public class TestSuiteParser {
private int testCaseNumber = 0;
private boolean expectNumericCompare;

private boolean previousLineContainsArgument = false;

// Lines inserted into the test program
private static final String COBOL_PERFORM_INITIALIZE = " PERFORM %sINITIALIZE";
private static final String COBOL_DISPLAY_TESTSUITE = " DISPLAY \"TESTSUITE:\"";
Expand Down Expand Up @@ -188,40 +186,38 @@ public List<String> getParsedTestSuiteLines(BufferedReader testSuiteReader,
continue;
}



boolean cobolTokenIsFieldName = (expectInProgress || expectQualifiedName || expectMockIdentifier
|| (expectMockArguments && !expectUsing));
Keyword keyword = Keywords.getKeywordFor(testSuiteToken, cobolTokenIsFieldName);


System.out.println("TESTING");
System.out.println(keyword.keywordAction());
System.out.println(testSuiteToken);

if (!verifyInProgress && expectUsing && expectMockArguments
&& !keyword.value().equals(Constants.USING_TOKEN)) {
// In this case we expected mock arguments, but got none. We end the mock and go
// to next token
expectMockArguments = false;
expectUsing = false;
// System.out.println("TESTING");
// System.out.println(keyword.keywordAction());
// System.out.println(testSuiteToken);
handleEndOfMockStatement(testSuiteReader, testSuiteToken, false);
testSuiteToken = getNextTokenFromTestSuite(testSuiteReader);
System.out.println(testSuiteToken);
continue;
}

if (!verifyInProgress && expectMockArguments
&& CobolVerbs.isStartOrEndCobolVerb(testSuiteToken)) {
// NEW: In this case we expected cobol verbs and stop counting arguments
// update the keyword as fieldname was assumed
keyword = Keywords.getKeywordFor(testSuiteToken, false);
// keyword = Keywords.getKeywordFor(testSuiteToken, false);
System.out.println("Appeared");
expectMockArguments = false;
expectUsing = false;
// System.out.println("TESTING");
// System.out.println(testSuiteToken);
// System.out.println(keyword.keywordAction());
ignoreCobolStatementAndFieldNameKeyAction=true;
handleEndOfMockStatement(testSuiteReader, testSuiteToken, previousLineContainsArgument);
handleEndOfMockStatement(testSuiteReader, testSuiteToken, false);
testSuiteToken = getNextTokenFromTestSuite(testSuiteReader);
previousLineContainsArgument=false;
continue;
}

Expand Down Expand Up @@ -384,7 +380,10 @@ public List<String> getParsedTestSuiteLines(BufferedReader testSuiteReader,
if (testSuiteToken.endsWith(","))
break;
}
previousLineContainsArgument = currentLineContainsArgument;
expectUsing = false;
if (!verifyInProgress) {
ignoreCobolStatementAndFieldNameKeyAction = true;
}
}

if (verifyInProgress) {
Expand Down

0 comments on commit 9c1b67d

Please sign in to comment.