MoinLight

tests/test_parser.py

0:5636794a7893
2017-04-26 Paul Boddie Moin wiki format utilities.
     1 #!/usr/bin/env python     2      3 from moinformat import parse, serialise, HTMLSerialiser     4      5 s = """\     6 Hello     7 {{{{#!xxx     8 A region     9 {{{    10 Another    11 }}}    12 End    13 }}}}    14 XXX    15 """    16     17 s2 = """\    18 Hello    19 {{{{    20 Start    21 }}}    22 Still in region    23 }}}}    24 End    25 """    26     27 s3 = """\    28 Hello {{{world}}} again"""    29     30 d = parse(s)    31 d2 = parse(s2)    32 d3 = parse(s3)    33     34 ns = serialise(d)    35 ns2 = serialise(d2)    36 ns3 = serialise(d3)    37     38 print ns == s    39 print    40 print ns    41 print "----"    42 print ns2 == s2    43 print    44 print ns2    45 print "----"    46 print ns3 == s3    47 print    48 print ns3    49 print "----"    50     51 print serialise(d, HTMLSerialiser)    52 print "----"    53 print serialise(d2, HTMLSerialiser)    54 print "----"    55 print serialise(d3, HTMLSerialiser)    56 print "----"    57     58 # vim: tabstop=4 expandtab shiftwidth=4