First steps · 2 / 69
Build a greeting
YOUR TASK
Make this happen
Lua joins strings with two dots. Keep the separator inside a string so the greeting has a space before the name.
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.greet = function(name: string): string return name end
lesson.test.lua
local t = require("test")
local subject = require("cococo.subject")
t.it("greets Ada", function()
local s = subject.load()
t.expect(s.greet("Ada")):eq("Hello, Ada")
end)
t.it("greets another person", function()
local s = subject.load()
t.expect(s.greet("Lin")):eq("Hello, Lin")
end)