util.human.io: Include relevant arguments in test messages
authorKim Alvefur <zash@zash.se>
Sun, 16 Jul 2023 19:17:06 +0200
changeset 13201 6beec4de8e63
parent 13200 eca44e058eed
child 13202 313c49c7566a
util.human.io: Include relevant arguments in test messages This way the relevant arguments are shown in case a test case fails
spec/util_human_io_spec.lua
--- a/spec/util_human_io_spec.lua	Sun Jul 16 18:42:58 2023 +0200
+++ b/spec/util_human_io_spec.lua	Sun Jul 16 19:17:06 2023 +0200
@@ -45,7 +45,7 @@
 
 	describe("parse_duration", function ()
 		local function test(expected, duration)
-			return assert.equal(expected, human_io.parse_duration(duration));
+			return assert.equal(expected, human_io.parse_duration(duration), ("%q -> %d"):format(duration, expected));
 		end
 		it("works", function ()
 			test(1, "1s");