-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain_test.go
More file actions
33 lines (28 loc) · 801 Bytes
/
main_test.go
File metadata and controls
33 lines (28 loc) · 801 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package main
import (
"testing"
"forge.lthn.ai/core/config"
"github.com/stretchr/testify/assert"
)
func TestGuiEnabled_Good_NilConfig(t *testing.T) {
// nil config should fall through to display detection.
result := guiEnabled(nil)
// On macOS/Windows this returns true; on Linux it depends on DISPLAY.
// Just verify it doesn't panic.
_ = result
}
func TestGuiEnabled_Good_WithConfig(t *testing.T) {
cfg, _ := config.New()
// Fresh config has no gui.enabled key — should fall through to OS detection.
result := guiEnabled(cfg)
_ = result
}
func TestStaticAssetGroup_Good(t *testing.T) {
s := &staticAssetGroup{
name: "test-assets",
basePath: "/assets/test",
dir: "/tmp",
}
assert.Equal(t, "test-assets", s.Name())
assert.Equal(t, "/assets/test", s.BasePath())
}