This commit is contained in:
2026-03-01 22:52:08 +07:00
commit 1244f3e2d5
63 changed files with 6075 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
package globals
import (
"testing"
"go.uber.org/fx/fxtest"
)
func TestNew(t *testing.T) {
// Set test values
Appname = "test-app"
Version = "1.0.0"
Buildarch = "test-arch"
lc := fxtest.NewLifecycle(t)
globals, err := New(lc)
if err != nil {
t.Fatalf("New() error = %v", err)
}
if globals.Appname != "test-app" {
t.Errorf("Appname = %v, want %v", globals.Appname, "test-app")
}
if globals.Version != "1.0.0" {
t.Errorf("Version = %v, want %v", globals.Version, "1.0.0")
}
if globals.Buildarch != "test-arch" {
t.Errorf("Buildarch = %v, want %v", globals.Buildarch, "test-arch")
}
}