This commit is contained in:
2025-11-14 12:11:44 +08:00
commit 39ebf61572
88 changed files with 9999 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
package config
import (
"os"
"path/filepath"
"testing"
)
func testConfigPath(t *testing.T, name string) string {
t.Helper()
return filepath.Join("testdata", name)
}
func writeTempConfig(t *testing.T, content string) string {
t.Helper()
dir := t.TempDir()
path := filepath.Join(dir, "config.toml")
if err := os.WriteFile(path, []byte(content), 0o600); err != nil {
t.Fatalf("写入临时配置失败: %v", err)
}
return path
}