Added support for pagebreaks (i.e. empty elements)

Change-Id: Ifa9114601f3d9fd954c5ba493a268e75ed9b834e
diff --git a/t/index/corpus/doc/0001/struct/structure.xml b/t/index/corpus/doc/0001/struct/structure.xml
index 68d4dc2..30edc1e 100644
--- a/t/index/corpus/doc/0001/struct/structure.xml
+++ b/t/index/corpus/doc/0001/struct/structure.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml-model href="span.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?>
 
-<layer docid="A01_APR.13047" xmlns="http://ids-mannheim.de/ns/KorAP" version="KorAP-0.4">
+<layer docid="Corpus_Doc.0001" xmlns="http://ids-mannheim.de/ns/KorAP" version="KorAP-0.4">
   <spanList>
     <span id="s0" from="0" to="128" l="1">
       <fs type="struct" xmlns="http://www.tei-c.org/ns/1.0">
@@ -89,6 +89,18 @@
         </f>
       </fs>
     </span>
+    <span id="sx" from="42" to="42" l="7">
+      <fs type="struct" xmlns="http://www.tei-c.org/ns/1.0">
+        <f name="name">pb</f>
+        <f name="attr">
+          <fs type="attr">
+            <f name="n">2</f>
+            <f name="id">Corpus.Doc-0001-pb2</f>
+            <f name="TEIform">pb</f>
+          </fs>
+        </f>
+      </fs>
+    </span>
     <span id="s10" from="43" to="128" l="6">
       <fs type="struct" xmlns="http://www.tei-c.org/ns/1.0">
         <f name="name">div</f>
diff --git a/t/index/dereko_struct.t b/t/index/dereko_struct.t
index 30c41f0..beaf248 100644
--- a/t/index/dereko_struct.t
+++ b/t/index/dereko_struct.t
@@ -21,7 +21,7 @@
 
 # Empty element (from 0 to 0) on level 1, with TUI 2
 is($data->{stream}->[0]->[1],
-   '<>:dereko/s:idsHeader$<b>65<i>0<i>0<i>1<b>1<s>2',
+   '<>:dereko/s:idsHeader$<b>65<i>0<i>0<i>0<b>1<s>2',
    'Empty element');
 
 # Attributes:
@@ -46,7 +46,17 @@
    'Attribute of idsHeader');
 
 
-diag 'TODO: Test for element spans';
+is($data->{stream}->[4]->[1],
+   '<>:dereko/s:s$<b>64<i>32<i>42<i>6<b>6<s>1',
+   'Sentence span');
+
+is($data->{stream}->[4]->[2],
+   '@:dereko/s:broken:no$<b>17<s>1<i>6',
+   'Attribute of sentence span');
+
+is($data->{stream}->[6]->[0],
+   '<>:dereko/s:pb$<b>65<i>42<i>42<i>6<b>6<s>1',
+   'Pagebreak element');
 
 done_testing;