Further irregularity testing for inline (SkipLineBreaks) formatting.
This commit is contained in:
parent
811df2d520
commit
043dedf2db
1 changed files with 21 additions and 5 deletions
|
|
@ -13,11 +13,12 @@ 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?`
|
||||
Psa32_4 string = `For day and night Your hand was heavy upon me; my strength was drained as in the summer heat. Selah`
|
||||
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?`
|
||||
Psa32_4 string = `For day and night Your hand was heavy upon me; my strength was drained as in the summer heat. Selah`
|
||||
John1_4_6 string = `In Him was life, and that life was the light of men. The Light shines in the darkness, and the darkness has not overcome it. There came a man who was sent from God. His name was John.`
|
||||
)
|
||||
|
||||
func loadScripture(s string) (*bible.Chapter, error) {
|
||||
|
|
@ -108,6 +109,21 @@ func Test_ChapterJSON(t *testing.T) {
|
|||
t.Error(" should be ->", Psa32_4)
|
||||
}
|
||||
|
||||
testJSON = &bytes.Buffer{}
|
||||
testJSON.WriteString(`{"numberOfVerses": 51, "chapter": {"number": 1, "content": [{"type": "verse", "number": 4, "content": ["In Him was life, and that life was the light of men."]}, {"type": "verse", "number": 5, "content": ["The Light shines in the darkness, and the darkness has not overcome", {"noteId": 0}, "it."]}, {"type": "heading", "content": ["The Witness of John"]}, {"type": "line_break"}, {"type": "verse", "number": 6, "content": ["There came a man who was sent from God. His name was John."]}]}}`)
|
||||
|
||||
c = &bible.Chapter{}
|
||||
if err := json.Unmarshal(testJSON.Bytes(), c); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
vv = c.FilterVerses(4, 6)
|
||||
vv.SkipLineBreaks = true
|
||||
if vv.String() != John1_4_6 {
|
||||
t.Error("John 1:4-6 did not match as expected:", vv.String())
|
||||
t.Error(" should be ->", John1_4_6)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func Test_VerseFilter(t *testing.T) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue