From e0a423dd292cd52a995c2195f2c1c88a5fe090f5 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 16 Jul 2023 18:42:58 +0200 Subject: util.human.io: Use tail call in test to get correct line numbers This is probably not guaranteed to work and might vary with Lua version, but it's good enough for me to get accurate line numbers out of Busted that don't all point to the test() function. --- spec/util_human_io_spec.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/util_human_io_spec.lua b/spec/util_human_io_spec.lua index c143d028..358d9a19 100644 --- a/spec/util_human_io_spec.lua +++ b/spec/util_human_io_spec.lua @@ -45,7 +45,7 @@ describe("util.human.io", function () describe("parse_duration", function () local function test(expected, duration) - assert.equal(expected, human_io.parse_duration(duration)); + return assert.equal(expected, human_io.parse_duration(duration)); end it("works", function () test(1, "1s"); -- cgit v1.2.3