From 197607849214425369faa7973592ffee33caf358 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Shelton" Date: Tue, 13 Oct 2026 15:03:15 -0600 Subject: [PATCH] Tests now cover Jude 5, 6, and Obadiah 5. --- internal/bible/types_test.go | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/internal/bible/types_test.go b/internal/bible/types_test.go index 35dcff9..4d90983 100644 --- a/internal/bible/types_test.go +++ b/internal/bible/types_test.go @@ -12,8 +12,9 @@ import ( ) const ( - Jude5 string = `Although you are fully aware of this, I want to remind you that after Jesus had delivered His people out of the land of Egypt, He destroyed those who did not believe.` - Jude6 string = `And the angels who did not stay within their own domain but abandoned their proper dwelling—these He has kept in eternal chains under darkness, bound for judgment on that great day.` + Jude5 string = `Although you are fully aware of this, I want to remind you that after Jesus had delivered His people out of the land of Egypt, He destroyed those who did not believe.` + Jude6 string = `And the angels who did not stay within their own domain but abandoned their proper dwelling—these He has kept in eternal chains under darkness, bound for judgment on that great day.` + Obadiah5 string = `“If thieves came to you, if robbers by night—oh, how you will be ruined—would they not steal only what they wanted? If grape gatherers came to you, would they not leave some gleanings?` ) func loadScripture(s string) (*bible.Chapter, error) { @@ -60,6 +61,20 @@ func Test_ChapterJSON(t *testing.T) { if vv.String() != Jude6 { t.Error("Jude 6 did not match as expected:", vv.String()) } + + testJSON = &bytes.Buffer{} + testJSON.WriteString(`{"numberOfVerses": 21, "chapter": {"number": 1, "content": [{"type": "verse", "number": 5, "content": [{"text": "\u201cIf thieves came to you,", "poem": 1}, {"text": "if robbers by night\u2014", "poem": 2}, {"text": "oh, how you will be ruined\u2014", "poem": 1}, {"text": "would they not steal only what they wanted?", "poem": 2}, {"text": "If grape gatherers came to you,", "poem": 1}, {"text": "would they not leave some gleanings?", "poem": 2}]}]}}`) + + c = &bible.Chapter{} + if err := json.Unmarshal(testJSON.Bytes(), c); err != nil { + t.Fatal(err) + } + + vv = c.FilterVerses(5, 5) + vv.SkipLineBreaks = true + if vv.String() != Obadiah5 { + t.Error("Obadiah 5 did not match as expected:", vv.String()) + } } func Test_VerseFilter(t *testing.T) { @@ -143,7 +158,7 @@ func Test_Bible_Reference(t *testing.T) { t.Fatal(err) } - verses, err := bible.Reference("jude 5") + verses, err := bible.Reference("obd 5") if err != nil { t.Fatal(err) }