Patchwork tests: correctly match clang-format version >= 10

login
register
mail settings
Submitter Manuel Jacob
Date July 20, 2020, 3:38 p.m.
Message ID <7f7cbec27d5a92d177ae.1595259506@tmp>
Download mbox | patch
Permalink /patch/46809/
State Accepted
Headers show

Comments

Manuel Jacob - July 20, 2020, 3:38 p.m.
# HG changeset patch
# User Manuel Jacob <me@manueljacob.de>
# Date 1595259481 -7200
#      Mon Jul 20 17:38:01 2020 +0200
# Node ID 7f7cbec27d5a92d177ae1c2b54e57318eaa94480
# Parent  ed58ecd5903033991e7fcbf560e83f7478acf08d
# EXP-Topic clang-format_version
tests: correctly match clang-format version >= 10

The previous regex only matched the first digit, so "clang-format version
10.0.0" was recognized as version 1.
Augie Fackler - July 20, 2020, 4:12 p.m.
On Mon, Jul 20, 2020 at 05:38:26PM +0200, Manuel Jacob wrote:
> # HG changeset patch
> # User Manuel Jacob <me@manueljacob.de>
> # Date 1595259481 -7200
> #      Mon Jul 20 17:38:01 2020 +0200
> # Node ID 7f7cbec27d5a92d177ae1c2b54e57318eaa94480
> # Parent  ed58ecd5903033991e7fcbf560e83f7478acf08d
> # EXP-Topic clang-format_version
> tests: correctly match clang-format version >= 10

queued, thanks

Patch

diff --git a/tests/hghave.py b/tests/hghave.py
--- a/tests/hghave.py
+++ b/tests/hghave.py
@@ -591,7 +591,7 @@ 
 
 @check("clang-format", "clang-format C code formatter")
 def has_clang_format():
-    m = matchoutput('clang-format --version', br'clang-format version (\d)')
+    m = matchoutput('clang-format --version', br'clang-format version (\d*)')
     # style changed somewhere between 4.x and 6.x
     return m and int(m.group(1)) >= 6