From 8e9aef7d489c79770017c3a7befe130017e888d1 Mon Sep 17 00:00:00 2001 From: Anders Schau Knatten Date: Fri, 20 Sep 2024 08:17:26 +0200 Subject: [PATCH] Update timsong link to use std23 --- quiz/templatetags/quiz_extras.py | 2 +- quiz/tests/unit/test_quiz_extras.py | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/quiz/templatetags/quiz_extras.py b/quiz/templatetags/quiz_extras.py index fec72c9..1b8d485 100644 --- a/quiz/templatetags/quiz_extras.py +++ b/quiz/templatetags/quiz_extras.py @@ -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})*" diff --git a/quiz/tests/unit/test_quiz_extras.py b/quiz/tests/unit/test_quiz_extras.py index 7fdedb1..22c0cef 100644 --- a/quiz/tests/unit/test_quiz_extras.py +++ b/quiz/tests/unit/test_quiz_extras.py @@ -9,26 +9,26 @@ 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')) @@ -36,6 +36,6 @@ def test_doesnt_try_to_format_numbered_references(self): 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]'))