| 73 | } |
| 74 | |
| 75 | func TestMain_WithNonExistentConfigFile(t *testing.T) { |
| 76 | // Test loading non-existent config file (should use defaults) |
| 77 | cfg, err := config.Load("non-existent-config.yaml") |
| 78 | if err != nil { |
| 79 | t.Fatalf("Failed to load default config: %v", err) |
| 80 | } |
| 81 | |
| 82 | // Check default values |
| 83 | if cfg.LogLevel != "info" { |
| 84 | t.Errorf("Expected log level 'info', got '%s'", cfg.LogLevel) |
| 85 | } |
| 86 | if cfg.Schedule.Interval != 1*time.Hour { |
| 87 | t.Errorf("Expected schedule interval 1h, got %v", cfg.Schedule.Interval) |
| 88 | } |
| 89 | } |
| 90 | |
| 91 | func TestMain_FlagParsing(t *testing.T) { |
| 92 | // Save original command line args |