基本功能实现

This commit is contained in:
2026-01-26 21:53:34 +08:00
commit c6e5e655f9
28 changed files with 4803 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
package config
import (
"testing"
)
func TestDefaultConfig(t *testing.T) {
err := Init("")
if err != nil {
t.Fatalf("Failed to init config: %v", err)
}
cfg := GetConfig()
if cfg.Server.Port != 8080 {
t.Errorf("Expected port 8080, got %d", cfg.Server.Port)
}
if cfg.DB.Type != "sqlite" {
t.Errorf("Expected DB type sqlite, got %s", cfg.DB.Type)
}
}