diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-09-17 11:44:09 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-09-17 11:44:09 +0200 |
| commit | 629ec29e33506a9bf96f552dcc2e6b6cd0560916 (patch) | |
| tree | 5d7ff9fd4b938764a4f9a98cc09b03b5fb2fdc6c /gui/internal/model/about_test.go | |
| parent | 0e56395aaa46359974a5eb21acaab32b2ea02a0f (diff) | |
| download | krino-629ec29e33506a9bf96f552dcc2e6b6cd0560916.tar.gz krino-629ec29e33506a9bf96f552dcc2e6b6cd0560916.zip | |
gui: the toolbar in the order things happen, and an About block
The Plan bar now reads left to right as the work does: which
directory, how it should be listed, what of it, where it is on disk -
then Scan, and only then what to do with what came back. Scan carries
the theme's accent, being the button that starts everything.
Settings ends with About: the program and the version it was built
as, what it is in a sentence, the licence, and who to write to. The
text is model.About so it is tested; ui.Version is stamped by main.
leak-check knows krino's own contact address, so the address check
stays useful without a per-clone setting.
Diffstat (limited to 'gui/internal/model/about_test.go')
| -rw-r--r-- | gui/internal/model/about_test.go | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/gui/internal/model/about_test.go b/gui/internal/model/about_test.go new file mode 100644 index 0000000..00a6718 --- /dev/null +++ b/gui/internal/model/about_test.go @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package model_test + +import ( + "strings" + "testing" + + "krino/gui/internal/model" +) + +// TestAboutSaysWhatItIs: the About block names the program, the version it +// was built as, the licence, who wrote it and how to reach them. +func TestAboutSaysWhatItIs(t *testing.T) { + lines := model.About("0.0.12") + if len(lines) == 0 { + t.Fatal("About returned nothing") + } + whole := strings.Join(lines, "\n") + for _, want := range []string{ + "krino", + "0.0.12", + "GPL-3.0-or-later", + "Lukasz Kasprzak", + "contact@labunix.xyz", + } { + if !strings.Contains(whole, want) { + t.Errorf("About does not mention %q:\n%s", want, whole) + } + } + if !strings.HasPrefix(lines[0], "krino ") { + t.Errorf("the first line should name the program and version, got %q", lines[0]) + } +} + +// TestAboutWithoutAVersion: a plain `go build` leaves "dev", and About says +// so rather than printing an empty version. +func TestAboutWithoutAVersion(t *testing.T) { + lines := model.About("") + if !strings.Contains(lines[0], "dev") { + t.Errorf("an unstamped build should read as dev, got %q", lines[0]) + } +} |
