mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Added a test for the behavior described by Jacob and it does fail
This commit is contained in:
@@ -10,3 +10,4 @@ Versioning Stuff
|
||||
deleted_end
|
||||
modified
|
||||
insert_beginning
|
||||
insert_similar
|
||||
|
||||
17
tests/root/versioning/insert_similar.txt
Normal file
17
tests/root/versioning/insert_similar.txt
Normal file
@@ -0,0 +1,17 @@
|
||||
Versioning test text
|
||||
====================
|
||||
|
||||
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
|
||||
|
||||
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.
|
||||
@@ -111,3 +111,12 @@ def test_insert_beginning():
|
||||
assert len(uids) == 4
|
||||
assert original_uids == uids[1:]
|
||||
assert original_uids[0] != uids[0]
|
||||
|
||||
def test_insert_similar():
|
||||
insert_similar = doctrees['versioning/insert_similar']
|
||||
new_nodes = list(merge_doctrees(original, insert_similar, is_paragraph))
|
||||
uids = [n.uid for n in insert_similar.traverse(is_paragraph)]
|
||||
assert len(new_nodes) == 1
|
||||
assert new_nodes[0].rawsource == u'Anyway I need more'
|
||||
assert original_uids[0] == uids[0]
|
||||
assert original_uids[1:] == uids[2:]
|
||||
|
||||
Reference in New Issue
Block a user