MCPcopy
hub / github.com/SurgeDM/Surge / TestLogFilePath

Function TestLogFilePath

internal/utils/debug_test.go:70–91  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

68}
69
70func TestLogFilePath(t *testing.T) {
71 // Verify logs directory path is valid
72 logsDir := config.GetLogsDir()
73
74 if logsDir == "" {
75 t.Error("GetLogsDir returned empty string")
76 }
77
78 // Path should contain expected directory name
79 if !strings.Contains(strings.ToLower(logsDir), "surge") {
80 t.Errorf("Logs directory should be under surge config, got: %s", logsDir)
81 }
82
83 if !strings.HasSuffix(logsDir, "logs") {
84 t.Errorf("Logs directory should end with 'logs', got: %s", logsDir)
85 }
86
87 // Should be a valid path format
88 if !filepath.IsAbs(logsDir) {
89 t.Errorf("Logs directory should be absolute path, got: %s", logsDir)
90 }
91}
92
93func TestCleanupLogs(t *testing.T) {
94 // Use a temporary directory for this test

Callers

nothing calls this directly

Calls 2

GetLogsDirFunction · 0.92
ErrorMethod · 0.80

Tested by

no test coverage detected