# HG changeset patch # User Anton Shestakov # Date 1674660342 -14400 # Node ID 42baf12efd210caef2465a3013096448df981e8f # Parent 37de1a154472921062b6ed001245465cadc0c7b8 tests: pygments 2.14+ highlight whitespace in python code diff -r 37de1a154472 -r 42baf12efd21 tests/hghave.py --- a/tests/hghave.py Wed Jan 25 18:54:17 2023 +0400 +++ b/tests/hghave.py Wed Jan 25 19:25:42 2023 +0400 @@ -693,6 +693,22 @@ return (major, minor) >= (2, 11) +@check("pygments214", "Pygments version >= 2.14") +def pygments214(): + 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, 14) + + @check("outer-repo", "outer repo") def has_outer_repo(): # failing for other reasons than 'no repo' imply that there is a repo diff -r 37de1a154472 -r 42baf12efd21 tests/test-highlight.t --- a/tests/test-highlight.t Wed Jan 25 18:54:17 2023 +0400 +++ b/tests/test-highlight.t Wed Jan 25 19:25:42 2023 +0400 @@ -163,7 +163,8 @@ import itertools def primes(): - """Generate all primes.""" + """Generate all primes.""" (pygments214 !) + """Generate all primes.""" (no-pygments214 !) def sieve(ns): p = ns.next() # It is important to yield *here* in order to stop the @@ -489,7 +490,8 @@ changeset - 10 """Generate all primes.""" + 10 """Generate all primes.""" (pygments214 !) + 10 """Generate all primes.""" (no-pygments214 !)