Skip to content

Commit

Permalink
Merge pull request #2357 from laws-africa/schedule-refs
Browse files Browse the repository at this point in the history
Plural schedule refs
  • Loading branch information
longhotsummer authored Feb 12, 2025
2 parents 8840f5c + f4d4ee8 commit 46a971c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions indigo/analysis/refs/provisions.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ class ProvisionRefsResolver:
"section": "section",
"sections": "section",
"schedule": "attachment",
"schedules": "attachment",
"subparagraph": ["subparagraph", "paragraph", "item"],
"subparagraphs": ["subparagraph", "paragraph", "item"],
"sub-paragraph": ["subparagraph", "paragraph", "item"],
Expand Down
2 changes: 2 additions & 0 deletions indigo/tests/test_provision_refs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1519,6 +1519,7 @@ def test_schedule_num(self):
<p>In Schedule 2.</p>
<p>In Schedule 2 and Schedule 2.</p>
<p>In Schedule 2 to 2.</p>
<p>In Schedules 2, 2 and 2.</p>
<p>In Scheduled work...</p>
<p>In the Schedule</p>
</content>
Expand All @@ -1534,6 +1535,7 @@ def test_schedule_num(self):
<p>In <ref href="#att_1">Schedule 2</ref>.</p>
<p>In <ref href="#att_1">Schedule 2</ref> and <ref href="#att_1">Schedule 2</ref>.</p>
<p>In <ref href="#att_1">Schedule 2</ref> to <ref href="#att_1">2</ref>.</p>
<p>In <ref href="#att_1">Schedules 2</ref>, <ref href="#att_1">2</ref> and <ref href="#att_1">2</ref>.</p>
<p>In Scheduled work...</p>
<p>In the Schedule</p>
</content>
Expand Down
8 changes: 8 additions & 0 deletions indigo/tests/test_provision_refs_grammar.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,14 @@ def test_schedules_num_range(self):
], result.references)
self.assertIsNone(result.target)

result = parse_provision_refs("Schedules 10, 11 and 12")
self.assertEqual([
MainProvisionRef('attachment', ProvisionRef('Schedule 10', 0, 12)),
MainProvisionRef('attachment', ProvisionRef('Schedule 11', 14, 16, separator='and_or')),
MainProvisionRef('attachment', ProvisionRef('Schedule 12', 21, 23, separator='and_or')),
], result.references)
self.assertIsNone(result.target)

def test_schedules_the_eng(self):
result = parse_provision_refs("the Schedule")
self.assertEqual([
Expand Down

0 comments on commit 46a971c

Please sign in to comment.