]> granicus.if.org Git - graphviz/commitdiff
add a test for date typos in the CHANGELOG
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 30 Nov 2022 05:31:37 +0000 (21:31 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 3 Dec 2022 05:46:13 +0000 (21:46 -0800)
The first cut of the upcoming release had such a typo in it.

tests/test_regression.py

index b93bfe04613837d655f9e73913c1d22ff4d58ed0..cb7cb273146817d0c99da4aa1686631f16734657 100644 (file)
@@ -2031,3 +2031,17 @@ def test_2307():
       continue
     assert re.search(r"\bG2_", m.group("url")) is not None, \
       "ID G2 was not applied to polygon fill url"
+
+def test_changelog_dates():
+  """
+  Check the dates of releases in the changelog are correctly formatted
+  """
+  changelog = Path(__file__).parent / "../CHANGELOG.md"
+  with open(changelog, "rt", encoding="utf-8") as f:
+    for lineno, line in enumerate(f, 1):
+      m = re.match(r"## \[\d+\.\d+\.\d+\] [-–] (?P<date>.*)$", line)
+      if m is None:
+        continue
+      d = re.match(r"\d{4}-\d{2}-\d{2}", m.group("date"))
+      assert d is not None, \
+        f"CHANGELOG.md:{lineno}: date in incorrect format: {line}"