diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-07-28 15:07:12 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-07-28 15:07:12 +0200 |
| commit | 310ac404f25b412c5c1ead12247b4eb36e9f0025 (patch) | |
| tree | 6e1dcc5e1f85a483cef7044d341b7c940c1690a8 /internal/calfeed/ical_test.go | |
| parent | 44472bbe31475a3c672ae003d928d7caffb4b50a (diff) | |
| parent | c5abf87fa7198c8f245f407774e2326e4b6c9b9c (diff) | |
| download | lectio-310ac404f25b412c5c1ead12247b4eb36e9f0025.tar.gz lectio-310ac404f25b412c5c1ead12247b4eb36e9f0025.zip | |
Merge branch 'engine-precedence-fixes': OF/EF calendar+readings flawlessness pass
Per-day validation vs litcal (OF) and missalemeum (EF) 2005-2050, all defects
fixed and re-validated to zero: OF calendar 0 real errors forward, OF readings
0 unresolvable, EF 0 reading gaps + resumed Sundays correct.
Diffstat (limited to 'internal/calfeed/ical_test.go')
| -rw-r--r-- | internal/calfeed/ical_test.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/internal/calfeed/ical_test.go b/internal/calfeed/ical_test.go index fb7ee9a..215c0e3 100644 --- a/internal/calfeed/ical_test.go +++ b/internal/calfeed/ical_test.go @@ -4,6 +4,8 @@ import ( "strings" "testing" "time" + + "github.com/lukaszkasprzak/lectio/internal/config" ) func TestICalEscapeInjection(t *testing.T) { @@ -19,6 +21,22 @@ func TestICalEscapeInjection(t *testing.T) { } } +// TestICalCarriesSourceOffer pins the AGPL-3.0 ยง13 offer into the VCALENDAR +// header. Someone who subscribes to /calendar.ics in their calendar app sees +// no lectio page at all; the feed is their entire view of the program, so it +// carries the offer. X- properties are inert to clients that ignore them. +func TestICalCarriesSourceOffer(t *testing.T) { + out := string(ICal("new", nil, time.Date(2026, 7, 27, 12, 0, 0, 0, time.UTC))) + for _, want := range []string{ + "X-LECTIO-SOURCE:" + icalEscape(config.SourceURL), + "X-LECTIO-LICENSE:" + icalEscape(config.License), + } { + if !strings.Contains(out, want) { + t.Errorf("missing %q in:\n%s", want, out) + } + } +} + func TestICalStructure(t *testing.T) { days := []DayView{{ Date: "2026-01-06", Season: "time-after-epiphany", Week: 1, Colour: "white", |
