The greeting
that stopped.
One surviving packet. One missing station name.

“Every genuine Lantern packet begins with a greeting and a station name. Rebuild that line, and we can trace this one.”
The relay is dark.
The record is not.
A terminal on the silent relay keeps printing an unfinished greeting: “Hello, ...”
Imani remembers the format. A genuine Lantern packet says hello to the station that sent it. The name is gone, but the test that checks the old formatter is still here.
What you’ll learn.
A Go function can take a station name and return a complete greeting. The test states what a correct greeting looks like before you change the function.
Give a small behavior a name, a parameter, and a return value.
Join fixed text with the station name supplied to the function.
Compare the greeting you get with the greeting you want.
If the same formatter works for several station names, the fragment can identify its source without trusting the dashboard.
Begin with the expected behavior.
The failing test already tells you the station name and exact greeting it expects.
got := Greeting("North Sluice")
want := "Hello, North Sluice"
Read the failure.
Change Greeting.
Run the test again.
Recover the station greeting.
Make Greeting(name) return Hello, followed by the name. The test expects Hello, North Sluice.
2
3
4
5
$ go test ./... FAIL TestGreeting got "Hello, ..."; want "Hello, North Sluice"
DESIGN PREVIEW — Test feedback is simulated; this page does not execute Go.