Typed Lua · 30 / 69
Make the return promise true
YOUR TASK
Make this happen
A return annotation describes every path through the function. Repair the string returned from a number-producing calculation.
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.square = function(n: number): number return "wrong" end
lesson.test.lua
local t = require("test")
local subject = require("cococo.subject")
t.it("squares a number", function()
local s = subject.load()
t.expect(s.square(4)):eq(16)
end)