diff options
Diffstat (limited to 'sw/qa/python/text_portion_enumeration_test.py')
-rw-r--r-- | sw/qa/python/text_portion_enumeration_test.py | 137 |
1 files changed, 137 insertions, 0 deletions
diff --git a/sw/qa/python/text_portion_enumeration_test.py b/sw/qa/python/text_portion_enumeration_test.py index 7251efe6d27a..407b96218bd9 100644 --- a/sw/qa/python/text_portion_enumeration_test.py +++ b/sw/qa/python/text_portion_enumeration_test.py @@ -1336,6 +1336,143 @@ class TextPortionEnumerationTest(unittest.TestCase): root.appendchild(href) self.dotest(root) + def test_end1(self): + name1 = self.mkname("bookmark") + name2 = self.mkname("toxmark") + name3 = self.mkname("refmark") + root = TreeNode() + root.appendchild(TextNode("abc")) + root.appendchild(BookmarkNode(name1)) + root.appendchild(DocumentIndexMarkNode(name2)) + root.appendchild(ReferenceMarkNode(name3)) + self.dotest(root) + + def test_end2(self): + name1 = self.mkname("bookmark") + name2 = self.mkname("frame") + name3 = self.mkname("refmark") + name4 = self.mkname("frame") + name5 = self.mkname("frame") + root = TreeNode() + root.appendchild(TextNode("abc")) + root.appendchild(BookmarkNode(name1)) + root.appendchild(FrameNode(name2, AT_CHARACTER)) + root.appendchild(ReferenceMarkNode(name3)) + root.appendchild(FrameNode(name4, AT_CHARACTER)) + root.appendchild(FrameNode(name5, AT_CHARACTER)) + self.dotest(root) + + def test_end3(self): + name1 = self.mkname("ftn") + name2 = self.mkname("toxmark") + root = TreeNode() + root.appendchild(TextNode("abc")) + root.appendchild(FootnoteNode(name1)) + root.appendchild(DocumentIndexMarkNode(name2)) + self.dotest(root) + + def test_end4(self): + name1 = self.mkname("bookmark") + name2 = self.mkname("frame") + root = TreeNode() + root.appendchild(BookmarkStartNode(name1)) + root.appendchild(TextNode("abc")) + root.appendchild(FrameNode(name2, AS_CHARACTER)) + root.appendchild(BookmarkEndNode(name1)) + self.dotest(root) + + def test_end5(self): + name1 = self.mkname("refmark") + name2 = self.mkname("ruby") + root = TreeNode() + root.appendchild(ReferenceMarkStartNode(name1)) + root.appendchild(TextNode("abc")) + ruby = RubyNode(name2) + ruby.appendchild(TextFieldNode("de")) + root.appendchild(ruby) + root.appendchild(ReferenceMarkEndNode(name1)) + self.dotest(root) + + def test_empty1(self): + name1 = self.mkname("refmark") + name2 = self.mkname("toxmark") + name3 = self.mkname("bookmark") + name4 = self.mkname("frame") + name7 = self.mkname("refmark") + name8 = self.mkname("toxmark") + name9 = self.mkname("bookmark") + nameA = self.mkname("frame") + root = TreeNode() + root.appendchild(ReferenceMarkNode(name1)) + root.appendchild(DocumentIndexMarkNode(name2)) + root.appendchild(BookmarkNode(name3)) + root.appendchild(FrameNode(name4, AT_CHARACTER)) + root.appendchild(ReferenceMarkNode(name7)) + root.appendchild(DocumentIndexMarkNode(name8)) + root.appendchild(BookmarkNode(name9)) + root.appendchild(FrameNode(nameA, AT_CHARACTER)) + self.dotest(root) + + def test_empty2(self): + name3 = self.mkname("bookmark") + name4 = self.mkname("frame") + name9 = self.mkname("bookmark") + nameA = self.mkname("frame") + root = TreeNode() + root.appendchild(BookmarkNode(name3)) + root.appendchild(FrameNode(name4, AT_CHARACTER)) + root.appendchild(BookmarkNode(name9)) + root.appendchild(FrameNode(nameA, AT_CHARACTER)) + self.dotest(root) + + def test_empty3(self): + name1 = self.mkname("refmark") + name2 = self.mkname("toxmark") + name3 = self.mkname("bookmark") + name4 = self.mkname("frame") + name5 = self.mkname("url") + name6 = self.mkname("ruby") + name7 = self.mkname("refmark") + name8 = self.mkname("toxmark") + name9 = self.mkname("bookmark") + nameA = self.mkname("frame") + root = TreeNode() + root.appendchild(ReferenceMarkNode(name1)) + root.appendchild(DocumentIndexMarkNode(name2)) + root.appendchild(BookmarkNode(name3)) + root.appendchild(FrameNode(name4, AT_CHARACTER)) + ## currently empty hyperlinks may get eaten... + # href = HyperlinkNode(name5) + # href.appendchild(TextNode("")) + # root.appendchild(href) + ruby = RubyNode(name6) + root.appendchild(ruby) + root.appendchild(ReferenceMarkNode(name7)) + root.appendchild(DocumentIndexMarkNode(name8)) + root.appendchild(BookmarkNode(name9)) + root.appendchild(FrameNode(nameA, AT_CHARACTER)) + self.dotest(root) + + def test1(self): + name1 = self.mkname("frame") + name2 = self.mkname("bookmark") + name3 = self.mkname("ruby") + name4 = self.mkname("ftn") + name5 = self.mkname("frame") + root = TreeNode() + root.appendchild(FrameNode(name1, AT_CHARACTER)) + root.appendchild(BookmarkStartNode(name2)) + root.appendchild(TextNode("abc")) + ruby = RubyNode(name3) + ruby.appendchild(TextNode("de")) + ruby.appendchild(FootnoteNode(name4)) + ruby.appendchild(BookmarkEndNode(name2)) + root.appendchild(ruby) + root.appendchild(TextNode("fg")) + root.appendchild(FrameNode(name5, AT_CHARACTER)) + root.appendchild(TextFieldNode("h")) + self.dotest(root) + def dotest(self, intree, insert=True): xDoc = self.__class__.xDoc self._dotest(xDoc, intree, insert) |