Comparison

spec/util_human_io_spec.lua @ 13196:eca44e058eed

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.
author Kim Alvefur <zash@zash.se>
date Sun, 16 Jul 2023 18:42:58 +0200
parent 13054:f4d7fe919969
child 13197:6beec4de8e63
comparison
equal deleted inserted replaced
13195:1a59a40c6443 13196:eca44e058eed
43 end); 43 end);
44 end); 44 end);
45 45
46 describe("parse_duration", function () 46 describe("parse_duration", function ()
47 local function test(expected, duration) 47 local function test(expected, duration)
48 assert.equal(expected, human_io.parse_duration(duration)); 48 return assert.equal(expected, human_io.parse_duration(duration));
49 end 49 end
50 it("works", function () 50 it("works", function ()
51 test(1, "1s"); 51 test(1, "1s");
52 test(60, "1mi"); 52 test(60, "1mi");
53 test(60, "1min"); 53 test(60, "1min");