mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-09-30 06:16:37 +08:00
9f8890d159
- Declared module Wavelet in backend/go.mod - Replaced github.com/Rain-kl/Wavelet/ with clean Wavelet/ import paths across backend codebase - Updated architecture guards, Makefile, swagger, and build tests - 100% passed all tests, lint checks, and binary compilation
48 lines
1.1 KiB
Go
48 lines
1.1 KiB
Go
// Copyright 2026 Arctel.net
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package cmd
|
|
|
|
import (
|
|
"strings"
|
|
"testing"
|
|
|
|
"Wavelet/pkg/buildinfo"
|
|
"Wavelet/pkg/config"
|
|
)
|
|
|
|
func TestFormatStartupBanner(t *testing.T) {
|
|
previousVersion := buildinfo.Version
|
|
previousBuildTime := buildinfo.BuildTime
|
|
previousEnv := config.Config.App.Env
|
|
previousAddr := config.Config.App.Addr
|
|
t.Cleanup(func() {
|
|
buildinfo.Version = previousVersion
|
|
buildinfo.BuildTime = previousBuildTime
|
|
config.Config.App.Env = previousEnv
|
|
config.Config.App.Addr = previousAddr
|
|
})
|
|
|
|
buildinfo.Version = "v3.2.1"
|
|
buildinfo.BuildTime = "2026-07-13T08:00:00Z"
|
|
config.Config.App.Env = "production"
|
|
config.Config.App.Addr = ":3000"
|
|
|
|
banner := formatStartupBanner(startupState{
|
|
mode: "API",
|
|
listensForHTTP: true,
|
|
})
|
|
|
|
for _, want := range []string{
|
|
"Wavelet v3.2.1",
|
|
"Environment: production",
|
|
"Build time: 2026-07-13T08:00:00Z",
|
|
"Listening: http://:3000",
|
|
"Mode: API",
|
|
} {
|
|
if !strings.Contains(banner, want) {
|
|
t.Errorf("banner missing %q:\n%s", want, banner)
|
|
}
|
|
}
|
|
}
|