20 lines
602 B
Go
20 lines
602 B
Go
package changes
|
|
|
|
import "testing"
|
|
|
|
func TestCompareWeekendDetectsOutlookChanges(t *testing.T) {
|
|
previous := outlookSnapshot(t, "2026-05-30", "70", 10, "9 AM", false)
|
|
current := outlookSnapshot(t, "2026-05-30", "78", 10, "9 AM", true)
|
|
|
|
changes, err := CompareWeekend(previous, current, Thresholds{TemperatureDegrees: 5})
|
|
if err != nil {
|
|
t.Fatalf("CompareWeekend() error = %v", err)
|
|
}
|
|
if len(changes) == 0 {
|
|
t.Fatal("changes length = 0, want weekend changes")
|
|
}
|
|
if countType(changes, "weekend_outlook_snow_risk_change") == 0 {
|
|
t.Fatalf("changes = %#v, want snow risk change", changes)
|
|
}
|
|
}
|