summaryrefslogtreecommitdiff
path: root/internal/config/config_test.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-03-13 10:01:59 +0200
committerPaul Buetow <paul@buetow.org>2026-03-13 10:01:59 +0200
commit44a426c883a2c448d40a19903c822d03e5cf70af (patch)
treedbb1fe11db1993c2cac7daf1c9930e37f44b38d1 /internal/config/config_test.go
parentcfddc5696f4956081630e3d394ef3d8c652af02e (diff)
chore: complete code quality audit fixesv1.2.6
- Fixed failing test in config_test.go (hardcoded date) - Addressed unchecked error returns from Close() operations - Refactored large functions to follow SRP (run.go and main.go) - Added documentation to exported identifiers - Fixed linting errors (error message capitalization, errcheck) - Bumped version to v1.2.6
Diffstat (limited to 'internal/config/config_test.go')
-rw-r--r--internal/config/config_test.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/internal/config/config_test.go b/internal/config/config_test.go
index adecc18..65e7767 100644
--- a/internal/config/config_test.go
+++ b/internal/config/config_test.go
@@ -1,6 +1,7 @@
package config
import (
+ "fmt"
"testing"
"time"
)
@@ -159,9 +160,10 @@ func isPausedAtTime(c Config, testTime time.Time) (bool, error) {
func TestIsPausedCurrentTime(t *testing.T) {
// Test with actual current time using the real IsPaused method
+ currentYear := time.Now().Year()
config := Config{
- PauseStart: "2025-01-01",
- PauseEnd: "2025-12-31",
+ PauseStart: fmt.Sprintf("%d-01-01", currentYear),
+ PauseEnd: fmt.Sprintf("%d-12-31", currentYear),
}
paused, err := config.IsPaused()
@@ -169,9 +171,9 @@ func TestIsPausedCurrentTime(t *testing.T) {
t.Errorf("Unexpected error: %v", err)
}
- // Since we're in 2025, this should be paused
+ // Since we're in the current year, this should be paused
if !paused {
- t.Errorf("Expected to be paused in 2025, but got false")
+ t.Errorf("Expected to be paused in %d, but got false", currentYear)
}
// Test with dates in the past