20 lines
441 B
Go
20 lines
441 B
Go
// Copyright (c) 2026 Petr Balvín <opensource@petrbalvin.org> (https://petrbalvin.org)
|
|||
|
|
// SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0
|
||
|
|
|
||
|
|
package version
|
||
|
|
|
||
|
|
import (
|
||
|
|
"strings"
|
||
|
|
"testing"
|
||
|
|
)
|
||
|
|
|
||
|
|
func TestVersionReportsABuild(t *testing.T) {
|
||
|
|
v := Version()
|
||
|
|
if v == "" {
|
||
|
|
t.Fatal("Version() = empty, want the recorded version or (devel)")
|
||
|
|
}
|
||
|
|
if strings.ContainsAny(v, " \t\n") {
|
||
|
|
t.Fatalf("Version() = %q, want a single token", v)
|
||
|
|
}
|
||
|
|
}
|