about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-03-10 09:47:10 -0800
committerKartik K. Agaram <vc@akkartik.com>2022-03-10 09:47:10 -0800
commit0fa83e1d94055d73fb656cf1db44f1937c7bec2a (patch)
treef86d4380ca4fa2bd67b07ecc2c0ec9ea4049ed83 /src
parent7030e70ef3b9e01218714286b98e1a038c4c2e7e (diff)
downloadteliva-0fa83e1d94055d73fb656cf1db44f1937c7bec2a.tar.gz
support fixing >1 test failure from within Teliva
This bug was caused by me forgetting that lua_setglobal affects the
stack.
Diffstat (limited to 'src')
-rw-r--r--src/teliva.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/teliva.c b/src/teliva.c
index 65f2acc..50ab015 100644
--- a/src/teliva.c
+++ b/src/teliva.c
@@ -1230,6 +1230,8 @@ static int run_tests(lua_State* L) {
       lua_pop(L, 1);
       if (first_failure_clear)
         lua_setglobal(L, "teliva_first_failure");
+      else
+        lua_pop(L, 1);
     }
     lua_pushnil(L);  /* just to undo loop update */
   }