Added Genesis 1:1-2 to parsing tests.

This commit is contained in:
Benjamin A. Shelton 2026-10-13 15:16:47 -06:00
commit 9c1c183ce1
Signed by: zancarius
GPG key ID: 8BD42DBD6C337E01

View file

@ -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)
}