From 9c1c183ce1aa7793aeaaa937933f281ff7b408b7 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Shelton" Date: Tue, 13 Oct 2026 15:16:47 -0600 Subject: [PATCH] Added Genesis 1:1-2 to parsing tests. --- internal/bible/types_test.go | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/internal/bible/types_test.go b/internal/bible/types_test.go index 4d90983..463d538 100644 --- a/internal/bible/types_test.go +++ b/internal/bible/types_test.go @@ -12,6 +12,7 @@ import ( ) const ( + Gen1_1_2 string = `In the beginning God created the heavens and the earth. Now the earth was formless and void, and darkness was over the surface of the deep. And the Spirit of God was hovering over the surface of the waters.` 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?` @@ -75,6 +76,20 @@ func Test_ChapterJSON(t *testing.T) { if vv.String() != Obadiah5 { t.Error("Obadiah 5 did not match as expected:", vv.String()) } + + testJSON = &bytes.Buffer{} + testJSON.WriteString(`{"numberOfVerses": 31, "chapter": {"number": 1, "content": [{"type": "verse", "number": 1, "content": ["In the beginning God created the heavens and the earth."]}, {"type": "line_break"}, {"type": "verse", "number": 2, "content": ["Now the earth was formless and void, and darkness was over the surface of the deep. And the Spirit of God was hovering over the surface of the waters."]}]}}`) + + c = &bible.Chapter{} + if err := json.Unmarshal(testJSON.Bytes(), c); err != nil { + t.Fatal(err) + } + + vv = c.FilterVerses(1, 2) + vv.SkipLineBreaks = true + if vv.String() != Gen1_1_2 { + t.Error("Genesis 1:1-2 did not match as expected:", vv.String()) + } } func Test_VerseFilter(t *testing.T) { @@ -158,7 +173,7 @@ func Test_Bible_Reference(t *testing.T) { t.Fatal(err) } - verses, err := bible.Reference("obd 5") + verses, err := bible.Reference("matt 23:12") if err != nil { t.Fatal(err) }