示例工程 11-formatting-and-bytes

11-formatting-and-bytes/01-format-specifiers/_test.lua

lua · 0.3 KB

-- @runtimes lua54 luajit
local h = require("harness")
local m = require("main")
h.describe("格式说明符", function()
	h.it("十六进制/浮点/宽度", function()
		local r = m.run(function() end)
		h.eq(r.hex, "00ff")
		h.eq(r.float, "3.14")
		h.eq(r.padded, "      hi")
	end)
end)
h.run()