2022-05-21 00:49:13 +02:00
|
|
|
// Copyright 2022 wanderer <a_mirre at utb dot cz>
|
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
2022-05-19 17:24:00 +02:00
|
|
|
package xkcdreader
|
|
|
|
|
|
|
|
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)
|
|
|
|
}
|
|
|
|
}
|
2022-05-23 00:49:04 +02:00
|
|
|
|
|
|
|
func TestToolbar(t *testing.T) {
|
|
|
|
wantItems := 4
|
|
|
|
gotToolbar := makeToolbar()
|
|
|
|
|
|
|
|
if len(gotToolbar.Items) != wantItems {
|
|
|
|
t.Errorf("Incorrect number of toolbar items, want: %d, got: %d", wantItems, len(gotToolbar.Items))
|
|
|
|
}
|
|
|
|
}
|