~technomancy/fennel

1

[PATCH] Include all tests in the "passed tests" count

Details
Message ID
<20190902025917.23748-1-benaiah@mischenko.com>
DKIM signature
pass
Download raw message
Patch: +14 -0
---
 test.lua | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/test.lua b/test.lua
index 2c627c3..6c75cba 100644
--- a/test.lua
+++ b/test.lua
@@ -520,6 +520,8 @@ for code, expected_msg in pairs(compile_failures) do
         fail = fail + 1
         print(" Expected " .. expected_msg .. " when compiling " .. code ..
                   " but got " .. msg)
+    else
+        pass = pass + 1
     end
 end
 
@@ -609,22 +611,30 @@ end
 if pcall(fennel.eval, "(->1 1 (+ 4))", {allowedGlobals = false}) then
     fail = fail + 1
     print(" Expected require-macros not leak into next evaluation.")
+else
+    pass = pass + 1
 end
 
 if pcall(fennel.eval, "`(hey)", {allowedGlobals = false}) then
     fail = fail + 1
     print(" Expected quoting lists to fail at runtime.")
+else
+    pass = pass + 1
 end
 
 if pcall(fennel.eval, "`[hey]", {allowedGlobals = false}) then
     fail = fail + 1
     print(" Expected quoting syms to fail at runtime.")
+else
+    pass = pass + 1
 end
 
 if not pcall(fennel.eval, "(.. hello-world :w)",
              {env = {["hello-world"] = "hi"}}) then
     fail = fail + 1
     print(" Expected global mangling to work.")
+else
+    pass = pass + 1
 end
 
 local g = {["hello-world"] = "hi", tbl = _G.tbl,
@@ -643,6 +653,8 @@ if(not pcall(fennel.eval, "(each [k (pairs _G)] (tset tbl k true))", {env = g})
    or not _G.tbl["hello-world"]) then
     fail = fail + 1
     print(" Expected wrapped _G to support env iteration.")
+else
+    pass = pass + 1
 end
 
 do
@@ -651,6 +663,8 @@ do
         or not pcall(fennel.eval, "x-x", {env = e})) then
         fail = fail + 1
         print(" Expected mangled globals to be accessible across eval invocations.")
+    else
+        pass = pass + 1
     end
 end
 
-- 
2.23.0.rc1
Details
Message ID
<87h85vl4zw.fsf@hagelb.org>
In-Reply-To
<20190902025917.23748-1-benaiah@mischenko.com> (view parent)
DKIM signature
missing
Download raw message
Thanks; applied! Nice catch.

-Phil