go-xkcdreader/main_test.go
surtur c05fc6c995
All checks were successful
continuous-integration/drone/push Build is passing
app: add test for a greeting message
* provide app greeting using a function
* test that the app greets properly

* run tests for nix with 'nix-shell --run'...
2022-05-07 00:31:44 +02:00

12 lines
233 B
Go

package main
import "testing"
func TestGreetingText(t *testing.T) {
want := "welcome to go-xkcdreader"
got := makeGreeting()
if got.Text != want {
t.Errorf("Incorrect initial greeting, want: %q, got: %q", want, got.Text)
}
}