Skip to content

Commit

Permalink
allow blank lines in encoder test input files
Browse files Browse the repository at this point in the history
for file input mode, if encoder test option selected, blank lines are
passed to the encoder; updated encoder test #1 expected results, which
contains a blank line
  • Loading branch information
thunder422 committed Sep 7, 2013
1 parent 9e0e442 commit c84fbfa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions test/encoder01.txt
Expand Up @@ -17,6 +17,9 @@ Output: 0:VarRefStr 1:|C$| 2:ConstStr 3:|Test| 4:Assign$
Input: PRINT C$
Output: 0:VarStr 1:|C$| 2:PrintStr 3:PRINT

Input:
Output:

Input: INPUT PROMPT "Enter:";D%:LET E=SQR(D%):PRINT D%,E' comment
Output: 0:ConstStr 1:|Enter:| 2:InputParseInt 3:InputBeginStr 4:VarRefInt 5:|D%| 6:InputAssignInt 7:INPUT-PROMPT':' 8:VarRef 9:|E| 10:VarInt 11:|D%| 12:CvtDbl 13:SQR( 14:Assign'LET:' 15:VarInt 16:|D%| 17:PrintInt 18:, 19:Var 20:|E| 21:PrintDbl 22:PRINT 23:' 24:| comment|

3 changes: 2 additions & 1 deletion test_ibcp.cpp
Expand Up @@ -203,7 +203,8 @@ bool Tester::run(QTextStream &cout, CommandLine *commandLine)
break;
}
inputLine = input.readLine();
if (inputLine.isEmpty() || inputLine[0] == '#')
if (inputLine[0] == '#'
|| m_option != OptEncoder && inputLine.isEmpty())
{
continue; // skip blank and comment lines
}
Expand Down

0 comments on commit c84fbfa

Please sign in to comment.