mirror of
https://github.com/Theodor-Springmann-Stiftung/lenz-web.git
synced 2025-12-16 14:35:32 +00:00
LENZ BRIEFAUSGABE
This commit is contained in:
23
xmlmodels/letter_text_test.go
Normal file
23
xmlmodels/letter_text_test.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package xmlmodels
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestPageRendering(t *testing.T) {
|
||||
content := `<letterText><page index="1"/><line>First</line><page index="2"/><line>Second</line></letterText>`
|
||||
parsed, err := parseText(nil, content)
|
||||
if err != nil {
|
||||
t.Fatalf("parse error: %v", err)
|
||||
}
|
||||
state := parsed.Data()
|
||||
for i, page := range state.Pages {
|
||||
t.Logf("page %d idx=%s html=%q", i, page.Index, page.HTML())
|
||||
}
|
||||
if len(state.Pages) != 2 {
|
||||
t.Fatalf("expected 2 pages, got %d", len(state.Pages))
|
||||
}
|
||||
for i, page := range state.Pages {
|
||||
if page.HTML() == "" {
|
||||
t.Fatalf("page %d empty", i)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user