# HG changeset patch # User Anders Johnsen # Date 1216983009 -7200 # Node ID e1e170c2cd44b0f1f314a8fd77f0466113f24cfb # Parent 7b274cfdc1dcdfed48ea3747892135eaba82d572 Fixed a error in the test program. diff -r 7b274cfdc1dc -r e1e170c2cd44 lexer/Lexer.d --- a/lexer/Lexer.d Fri Jul 25 12:18:05 2008 +0200 +++ b/lexer/Lexer.d Fri Jul 25 12:50:09 2008 +0200 @@ -227,6 +227,7 @@ } Token slash() { + int p = position; switch(source[position]) { case '=': @@ -250,7 +251,7 @@ return this.next; } } - messages.report(UnexpectedEOFBlock,Loc(position)).fatal(ExitLevel.Lexer); + messages.report(UnexpectedEOFBlock,Loc(p)).fatal(ExitLevel.Lexer); case '+': position += 2; @@ -277,7 +278,7 @@ } messages.report( UnexpectedEOFBlock, - Loc(position)).fatal(ExitLevel.Lexer); + Loc(p)).fatal(ExitLevel.Lexer); default: return Token(Tok.Slash, Loc(position - 1), 1); diff -r 7b274cfdc1dc -r e1e170c2cd44 tests/lexer/Comments2.d --- a/tests/lexer/Comments2.d Fri Jul 25 12:18:05 2008 +0200 +++ b/tests/lexer/Comments2.d Fri Jul 25 12:50:09 2008 +0200 @@ -1,4 +1,6 @@ //fail -/+ +/+ + + diff -r 7b274cfdc1dc -r e1e170c2cd44 tests/run.d --- a/tests/run.d Fri Jul 25 12:18:05 2008 +0200 +++ b/tests/run.d Fri Jul 25 12:50:09 2008 +0200 @@ -101,6 +101,7 @@ if (line.length >= 2 && line[0 .. 2] == "//") { foreach (command; line[2 .. $].delimiters(",;")) + { switch (toLower(substitute(command, " ", ""))) { case "skip", "dontcompile": @@ -117,6 +118,8 @@ default: break; } + break; + } } if (compile) @@ -149,7 +152,7 @@ return s; } - bool unexpected = (result != expected); + bool unexpected = expected == 0 ? result != 0 : result == 0; auto f = unexpected? &bad : &good; char[] s = (result == 0)? "SUCCESS" : "FAILURE"; // always print if unexpeted, otherwise check the settings