~ubuntu-branches/ubuntu/hardy/python-docutils/hardy

« back to all changes in this revision

Viewing changes to test/test_parsers/test_rst/test_field_lists.py

  • Committer: Bazaar Package Importer
  • Author(s): martin f. krafft
  • Date: 2006-07-10 11:45:05 UTC
  • mfrom: (2.1.4 edgy)
  • Revision ID: james.westby@ubuntu.com-20060710114505-otkhqcslevewxmz5
Tags: 0.4-3
Added build dependency on python-central (closes: #377580).

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 
3
3
# Author: David Goodger
4
4
# Contact: goodger@users.sourceforge.net
5
 
# Revision: $Revision: 1.10 $
6
 
# Date: $Date: 2003/12/19 14:30:13 $
 
5
# Revision: $Revision: 4083 $
 
6
# Date: $Date: 2005-11-20 00:48:04 +0100 (Sun, 20 Nov 2005) $
7
7
# Copyright: This module has been placed in the public domain.
8
8
 
9
9
"""
444
444
        <field>
445
445
            <field_name>
446
446
                Field name with \n\
447
 
                <problematic id="id2" refid="id1">
 
447
                <problematic ids="id2" refid="id1">
448
448
                    *
449
449
                bad inline markup
450
450
            <field_body>
451
 
                <system_message backrefs="id2" id="id1" level="2" line="1" source="test data" type="WARNING">
 
451
                <system_message backrefs="id2" ids="id1" level="2" line="1" source="test data" type="WARNING">
452
452
                    <paragraph>
453
453
                        Inline emphasis start-string without end-string.
454
454
                <paragraph>
455
455
                    should generate warning.
456
456
"""],
457
 
["""\
458
 
Some edge cases:
 
457
[r"""Some edge cases:
459
458
 
460
459
:Empty:
461
460
:Author: Me
468
467
Field: marker is missing its open-colon.
469
468
 
470
469
:Field marker is missing its close-colon.
 
470
 
 
471
:Field\: names\: with\: colons\:: are possible.
 
472
 
 
473
:\\Field\  names with backslashes\\: are possible, too.
 
474
 
 
475
:\\: A backslash.
 
476
 
 
477
:Not a\\\: field list.
 
478
 
 
479
:Not a \: field list either.
 
480
 
 
481
:\: Not a field list either.
 
482
 
 
483
:\:
 
484
    A definition list, not a field list.
471
485
""",
472
486
"""\
473
487
<document source="test data">
497
511
        Field: marker is missing its open-colon.
498
512
    <paragraph>
499
513
        :Field marker is missing its close-colon.
 
514
    <field_list>
 
515
        <field>
 
516
            <field_name>
 
517
                Field: names: with: colons:
 
518
            <field_body>
 
519
                <paragraph>
 
520
                    are possible.
 
521
        <field>
 
522
            <field_name>
 
523
                \\Field names with backslashes\\
 
524
            <field_body>
 
525
                <paragraph>
 
526
                    are possible, too.
 
527
        <field>
 
528
            <field_name>
 
529
                \\
 
530
            <field_body>
 
531
                <paragraph>
 
532
                    A backslash.
 
533
    <paragraph>
 
534
        :Not a\\: field list.
 
535
    <paragraph>
 
536
        :Not a : field list either.
 
537
    <paragraph>
 
538
        :: Not a field list either.
 
539
    <definition_list>
 
540
        <definition_list_item>
 
541
            <term>
 
542
                ::
 
543
            <definition>
 
544
                <paragraph>
 
545
                    A definition list, not a field list.
500
546
"""],
501
547
]
502
548