Comparison

spec/util_human_io_spec.lua @ 13197:6beec4de8e63

util.human.io: Include relevant arguments in test messages This way the relevant arguments are shown in case a test case fails
author Kim Alvefur <zash@zash.se>
date Sun, 16 Jul 2023 19:17:06 +0200
parent 13196:eca44e058eed
child 13198:313c49c7566a
comparison
equal deleted inserted replaced
13196:eca44e058eed 13197:6beec4de8e63
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 return assert.equal(expected, human_io.parse_duration(duration)); 48 return assert.equal(expected, human_io.parse_duration(duration), ("%q -> %d"):format(duration, expected));
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");