diff tests/run.d @ 186:e1e170c2cd44

Fixed a error in the test program.
author Anders Johnsen <skabet@gmail.com>
date Fri, 25 Jul 2008 12:50:09 +0200
parents 0ea5d2f3e96b
children fda35d57847e
line wrap: on
line diff
--- 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