Skip to content

Commit

Permalink
Update timsong link to use std23
Browse files Browse the repository at this point in the history
  • Loading branch information
knatten committed Sep 20, 2024
1 parent 8fc44e7 commit 8e9aef7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion quiz/templatetags/quiz_extras.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def format_reference(match):
full_reference = match.group(0)
section_name = match.group('section_name')
paragraph_number = match.group('paragraph')
full_link = "https://timsong-cpp.github.io/cppwp/n4659/" + section_name
full_link = "https://timsong-cpp.github.io/cppwp/std23/" + section_name
if paragraph_number:
full_link = full_link + "#" + paragraph_number
return f"*[{full_reference}]({full_link})*"
Expand Down
16 changes: 8 additions & 8 deletions quiz/tests/unit/test_quiz_extras.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,33 @@ def test_given_no_reference(self):

def test_given_just_section(self):
self.assertEqual(
'*[§[foo]](https://timsong-cpp.github.io/cppwp/n4659/foo)*',
'*[§[foo]](https://timsong-cpp.github.io/cppwp/std23/foo)*',
standard_ref('§[foo]'))
self.assertEqual(
'*[§[foo.bar]](https://timsong-cpp.github.io/cppwp/n4659/foo.bar)*',
'*[§[foo.bar]](https://timsong-cpp.github.io/cppwp/std23/foo.bar)*',
standard_ref('§[foo.bar]'))
self.assertEqual(
'*[§[foo::bar]](https://timsong-cpp.github.io/cppwp/n4659/foo::bar)*',
'*[§[foo::bar]](https://timsong-cpp.github.io/cppwp/std23/foo::bar)*',
standard_ref('§[foo::bar]'))

def test_given_section_and_paragraph(self):
self.assertEqual(
'*[§[foo.bar]¶1.2](https://timsong-cpp.github.io/cppwp/n4659/foo.bar#1.2)*',
'*[§[foo.bar]¶1.2](https://timsong-cpp.github.io/cppwp/std23/foo.bar#1.2)*',
standard_ref('§[foo.bar]¶1.2'))
self.assertEqual(
'*[§[foo]¶note-1](https://timsong-cpp.github.io/cppwp/n4659/foo#note-1)*',
'*[§[foo]¶note-1](https://timsong-cpp.github.io/cppwp/std23/foo#note-1)*',
standard_ref('§[foo]¶note-1'))

def test_doesnt_include_too_much(self):
self.assertEqual(
'*[§[foo.bar]¶1](https://timsong-cpp.github.io/cppwp/n4659/foo.bar#1)*.', standard_ref('§[foo.bar]¶1.'))
'*[§[foo.bar]¶1](https://timsong-cpp.github.io/cppwp/std23/foo.bar#1)*.', standard_ref('§[foo.bar]¶1.'))

def test_doesnt_try_to_format_numbered_references(self):
self.assertEqual('§1.2.3', standard_ref('§1.2.3'))
self.assertEqual('§1.2.3¶1', standard_ref('§1.2.3¶1'))

def test_given_multiple_paragraphs(self):
self.assertEqual(
'*[§[foo]](https://timsong-cpp.github.io/cppwp/n4659/foo)*'
'*[§[bar]](https://timsong-cpp.github.io/cppwp/n4659/bar)*',
'*[§[foo]](https://timsong-cpp.github.io/cppwp/std23/foo)*'
'*[§[bar]](https://timsong-cpp.github.io/cppwp/std23/bar)*',
standard_ref('§[foo]§[bar]'))

0 comments on commit 8e9aef7

Please sign in to comment.