From cc30f929b5f8edaed8a9f8a52cc44de71d9ebfe2 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Thu, 17 Sep 2026 08:47:16 +0200 Subject: fix: correct the day/night constants in Task 1's test DAY was 1000 against a sunrise of 1500, so every timestamp in the test evaluated as night and the first day assertion could never pass. The implementation was right; the test constants were not. DAY is now 1700, inside the 1500..1900 window, with a comment saying why the value has to be checked against the window rather than just named. Caught by the Task 1 implementer, which stopped rather than quietly inverting the day/night comparison to make the assertions pass. Co-Authored-By: Claude Opus 5 --- docs/superpowers/plans/2026-09-17-weather-widget.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/superpowers/plans/2026-09-17-weather-widget.md b/docs/superpowers/plans/2026-09-17-weather-widget.md index 14c7044..853e08c 100644 --- a/docs/superpowers/plans/2026-09-17-weather-widget.md +++ b/docs/superpowers/plans/2026-09-17-weather-widget.md @@ -68,7 +68,10 @@ local weather = require 'lib.weather' -- ranges come from the polybar script that ran against this API for years. -- Each assertion pairs the last id in a range with the first id of the next, -- which is where an off-by-one would hide. -local DAY, NIGHT = 1000, 2000 -- timestamps either side of the sun, set below +-- Sunrise 1500, sunset 1900, so DAY must sit INSIDE that window and NIGHT +-- outside it. Naming them without checking them against the window is how the +-- first draft of this test made every timestamp evaluate as night. +local DAY, NIGHT = 1700, 2000 local function icon(id, now) return weather.icon(id, now, 1500, 1900) -- sunrise 1500, sunset 1900 -- cgit v1.2.3