[Updated] D11970: tests: support pygments 2.11 (issue6628)

ced (Cédric Krier) phabricator at mercurial-scm.org
Mon Jan 17 10:54:19 UTC 2022


Closed by commit rHG21c0ae0693bc: tests: support pygments 2.11 (issue6628) (authored by ced).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D11970?vs=31625&id=31660

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D11970/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D11970

AFFECTED FILES
  tests/hghave.py
  tests/test-run-tests.t

CHANGE DETAILS

diff --git a/tests/test-run-tests.t b/tests/test-run-tests.t
--- a/tests/test-run-tests.t
+++ b/tests/test-run-tests.t
@@ -176,14 +176,19 @@
   running 1 tests using 1 parallel processes 
   
   \x1b[38;5;124m--- $TESTTMP/test-failure.t\x1b[39m (esc)
-  \x1b[38;5;34m+++ $TESTTMP/test-failure.t.err\x1b[39m (esc)
+  \x1b[38;5;28m+++ $TESTTMP/test-failure.t.err\x1b[39m (esc) (pygments211 !)
+  \x1b[38;5;34m+++ $TESTTMP/test-failure.t.err\x1b[39m (esc) (no-pygments211 !)
   \x1b[38;5;90;01m@@ -1,4 +1,4 @@\x1b[39;00m (esc)
-     $ echo "bar-baz"; echo "bar-bad"; echo foo
-  \x1b[38;5;34m+  bar*baz (glob)\x1b[39m (esc)
-     bar*bad (glob)
+  \x1b[38;5;250m \x1b[39m  $ echo "bar-baz"; echo "bar-bad"; echo foo (esc) (pygments211 !)
+     $ echo "bar-baz"; echo "bar-bad"; echo foo (no-pygments211 !)
+  \x1b[38;5;28m+  bar*baz (glob)\x1b[39m (esc) (pygments211 !)
+  \x1b[38;5;34m+  bar*baz (glob)\x1b[39m (esc) (no-pygments211 !)
+  \x1b[38;5;250m \x1b[39m  bar*bad (glob) (esc) (pygments211 !)
+     bar*bad (glob) (no-pygments211 !)
   \x1b[38;5;124m-  bar*baz (glob)\x1b[39m (esc)
   \x1b[38;5;124m-  | fo (re)\x1b[39m (esc)
-  \x1b[38;5;34m+  foo\x1b[39m (esc)
+  \x1b[38;5;28m+  foo\x1b[39m (esc) (pygments211 !)
+  \x1b[38;5;34m+  foo\x1b[39m (esc) (no-pygments211 !)
   
   \x1b[38;5;88mERROR: \x1b[39m\x1b[38;5;9mtest-failure.t\x1b[39m\x1b[38;5;88m output changed\x1b[39m (esc)
   !
diff --git a/tests/hghave.py b/tests/hghave.py
--- a/tests/hghave.py
+++ b/tests/hghave.py
@@ -663,6 +663,22 @@
     return (major, minor) >= (2, 5)
 
 
+ at check("pygments211", "Pygments version >= 2.11")
+def pygments211():
+    try:
+        import pygments
+
+        v = pygments.__version__
+    except ImportError:
+        return False
+
+    parts = v.split(".")
+    major = int(parts[0])
+    minor = int(parts[1])
+
+    return (major, minor) >= (2, 11)
+
+
 @check("outer-repo", "outer repo")
 def has_outer_repo():
     # failing for other reasons than 'no repo' imply that there is a repo



To: ced, #hg-reviewers, marmoute, Alphare
Cc: Alphare, mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20220117/e807ab6f/attachment-0002.html>


More information about the Mercurial-patches mailing list