Working with data · 21 / 69
Format a label
YOUR TASK
Make this happen
string.format combines a format string and typed arguments. Produce a label with a name, a colon and an integer count.
Read the cases in
lesson.test.lua, then choose Check solution to see what needs to change.Update
subject.luauntil every test passes. Keep the supplied tests unchanged.
Read the starter and tests
subject.lua
exports.label = function(name: string, count: number): string return name end
lesson.test.lua
local t = require("test")
local subject = require("cococo.subject")
t.it("label includes count", function()
local s = subject.load()
t.expect(s.label("Paper", 12)):eq("Paper: 12")
end)