From 26f695f480799400505e4db4564f3ac0866dc24c Mon Sep 17 00:00:00 2001 From: John O'Keefe Date: Thu, 30 Jul 2026 12:12:18 -0400 Subject: [PATCH] fix(opds): correct feed tests referencing non-existent entry fields The OPDS feed test suite did not compile or pass: - TestNewEntry asserted on entry.Creator, but the Entry struct stores the creator under Author.Name (the Atom element). Assert on entry.Author.Name instead. - TestFeedGenerateXML expected / elements, but the Entry struct emits standard Atom and <author><name>. Update the expected substrings to match the actual (correct) output. These are pre-existing assertion errors unrelated to any field being removed; the code under test was already correct. --- internal/opds/feed_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/opds/feed_test.go b/internal/opds/feed_test.go index c26185d..2e7081c 100644 --- a/internal/opds/feed_test.go +++ b/internal/opds/feed_test.go @@ -71,8 +71,8 @@ func TestNewEntry(t *testing.T) { t.Errorf("expected Title to be 'Test Title', got '%s'", entry.Title) } - if entry.Creator != "Test Author" { - t.Errorf("expected Creator to be 'Test Author', got '%s'", entry.Creator) + if entry.Author == nil || entry.Author.Name != "Test Author" { + t.Errorf("expected Author.Name to be 'Test Author', got %v", entry.Author) } if entry.Updated != "2023-01-01T00:00:00Z" { @@ -201,8 +201,8 @@ func TestFeedGenerateXML(t *testing.T) { `<title>Test Feed`, ``, `urn:uuid:book-id`, - `Test Book`, - `Test Author`, + `Test Book`, + `Test Author`, `book-uuid-123`,