~technomancy/fennel

Include all tests in the "passed tests" count v1 PROPOSED

Benaiah Mischenko: 1
 Include all tests in the "passed tests" count

 1 files changed, 14 insertions(+), 0 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~technomancy/fennel/patches/7885/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH] Include all tests in the "passed tests" count Export this patch

---
 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
Thanks; applied! Nice catch.

-Phil