package buildinfo import "testing" // The User-Agent carries the build's own version, so MusicBrainz and the // others can tell a release from a dev build, and a contact: the operator's // when set, the project's otherwise. func TestUserAgent_NamesTheVersionAndAContact(t *testing.T) { was := Version t.Cleanup(func() { Version = was }) Version = "2026.11.28.1700" if got, want := UserAgent("admin@example.com"), "Minstrel/2026.11.28.1700 ( admin@example.com )"; got != want { t.Errorf("with a contact: %q, want %q", got, want) } if got, want := UserAgent(""), "Minstrel/2026.11.28.1700 ( "+ProjectURL+" )"; got != want { t.Errorf("without one: %q, want %q", got, want) } }