Commits

jacobmason committed 1f5ad4b Merge

merge with Dasich

Comments (0)

Files changed (3)

tests/root/versioning/index.txt

     deleted
     deleted_end
     modified
+    insert_beginning

tests/root/versioning/insert_beginning.txt

+Versioning test text
+====================
+
+Apperantly inserting a paragraph at the beginning of a document caused
+problems earlier so this document should be used to test that.
+
+So the thing is I need some kind of text - not the lorem ipsum stuff, that
+doesn't work out that well - to test :mod:`sphinx.versioning`. I couldn't find
+a good text for that under public domain so I thought the easiest solution is
+to write one by myself. It's not really interesting, in fact it is *really*
+boring.
+
+Anyway I need more than one paragraph, at least three for the original
+document, I think, and another one for two different ones.
+
+So the previous paragraph was a bit short because I don't want to test this
+only on long paragraphs, I hope it was short enough to cover most stuff.
+Anyway I see this lacks ``some markup`` so I have to add a **little** bit.

tests/test_versioning.py

     assert len(new_nodes) == 1
     assert original_uids[0] == uids[0]
     assert original_uids[1:] == uids[2:]
+
+def test_insert_beginning():
+    insert_beginning = doctrees['versioning/insert_beginning']
+    new_nodes = list(merge_doctrees(original, insert_beginning, is_paragraph))
+    uids = [n.uid for n in insert_beginning.traverse(is_paragraph)]
+    assert len(new_nodes) == 1
+    assert len(uids) == 4
+    assert original_uids == uids[1:]
+    assert original_uids[0] != uids[0]