diff options
author | Kim Alvefur <zash@zash.se> | 2023-07-16 18:42:58 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2023-07-16 18:42:58 +0200 |
commit | e0a423dd292cd52a995c2195f2c1c88a5fe090f5 (patch) | |
tree | 942fb165533c5ae2b8b676277250e06d567e8138 | |
parent | a906513d328a5f2cece050c5936571a185ce5384 (diff) | |
download | prosody-e0a423dd292cd52a995c2195f2c1c88a5fe090f5.tar.gz prosody-e0a423dd292cd52a995c2195f2c1c88a5fe090f5.zip |
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.
-rw-r--r-- | spec/util_human_io_spec.lua | 2 |
1 files changed, 1 insertions, 1 deletions
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"); |