go-xkcdreader/main_test.go
surtur ecfb129096
All checks were successful
continuous-integration/drone/push Build is passing
main: add more tests
2022-05-13 22:41:31 +02:00

31 lines
554 B
Go

package main
import (
"testing"
"git.dotya.ml/wanderer/go-xkcdreader/cmd"
)
func TestGreetingText(t *testing.T) {
want := "welcome to " + cmd.GetAppName()
got := makeGreeting()
if got.Text != want {
t.Errorf("Incorrect initial greeting, want: %q, got: %q", want, got.Text)
}
}
func TestLocalgetVersion(t *testing.T) {
want := version
got := getVersion()
if got != want {
t.Errorf("Incorrect version from getVersion, want: %q, got: %q", want, got)
}
}
// does this test even make sense?
func TestExecMain(t *testing.T) {
go main()
}