/[alph]/alph/org/nongnu/alph/xml/serialization.test
ViewVC logotype

Diff of /alph/org/nongnu/alph/xml/serialization.test

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by tjl, Sun Apr 6 06:56:08 2003 UTC revision 1.5 by tjl, Sun Apr 6 10:55:59 2003 UTC
# Line 17  class Ts(alph.TextSpan): Line 17  class Ts(alph.TextSpan):
17          return self.s          return self.s
18      def length(self):      def length(self):
19          return self.e-self.s          return self.e-self.s
20      def getScrollBlock(self):      def getScrollId(self):
21          return self.sb          return self.sb.getID()
22        def toString(self):
23            return "[Fake span]"
24    
25  class Sb(alph.TextScrollBlock):  class Sb(alph.TextScrollBlock):
26      def __init__(self, id):      def __init__(self, id):
# Line 84  def testMultiple(): Line 86  def testMultiple():
86      list = r.getSpans()      list = r.getSpans()
87      failUnlessEqual(list.size(), 2)      failUnlessEqual(list.size(), 2)
88    
89    def testURN5():
90        """See that reading and writing URN-5 spans works
91        """
92        r = SpanReader()
93        str = """<uts b="Q" o="5" t="foo&amp;bar"/>"""
94        parseString(str, r)
95        sp = r.getSpans()[0]
96        failUnlessEqual(sp.getScrollId(), "Q")
97        failUnlessEqual(sp.offset(), 5)
98        failUnlessEqual(sp.getText(), "foo&bar")
99    
100        failUnlessEqual(SpanSerializer().span2xml(sp), str)

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26