31 lines
554 B
Go
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()
|
|
}
|