initial
This commit is contained in:
30
internal/globals/globals_test.go
Normal file
30
internal/globals/globals_test.go
Normal 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")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user