mirror of
https://git.fightbot.fun/hxuanyu/BingPaper.git
synced 2026-02-15 17:19:30 +08:00
22 lines
367 B
Go
22 lines
367 B
Go
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)
|
|
}
|
|
}
|