99
1010# filename, pattern, number of occurrences
1111file_pattern_count = [
12- (
13- f"{ root } /meson.build" ,
14- r"version: '(\d+)\.(\d+)\.(\d+)'" ,
15- 1 ),
16- (
17- f"{ root } /include/ankerl/unordered_dense.h" ,
18- r"Version (\d+)\.(\d+)\.(\d+)\n" ,
19- 1 ),
20- (
21- f"{ root } /CMakeLists.txt" ,
22- r"^\s+VERSION (\d+)\.(\d+)\.(\d+)\n" ,
23- 1 ),
24- (
25- f"{ root } /test/unit/namespace.cpp" ,
26- r"unordered_dense::v(\d+)_(\d+)_(\d+)" ,
27- 1
28- )
12+ (f"{ root } /CMakeLists.txt" , r"^\s+VERSION (\d+)\.(\d+)\.(\d+)\n" , 1 ),
13+ (f"{ root } /include/ankerl/stl.h" , r"Version (\d+)\.(\d+)\.(\d+)\n" , 1 ),
14+ (f"{ root } /include/ankerl/unordered_dense.h" , r"Version (\d+)\.(\d+)\.(\d+)\n" , 1 ),
15+ (f"{ root } /meson.build" , r"version: '(\d+)\.(\d+)\.(\d+)'" , 1 ),
16+ (f"{ root } /test/unit/namespace.cpp" , r"unordered_dense::v(\d+)_(\d+)_(\d+)" , 1 ),
2917]
3018
3119# let's parse the reference from svector.h
4937 exit (1 )
5038
5139is_ok = True
52- for ( filename , pattern , count ) in file_pattern_count :
40+ for filename , pattern , count in file_pattern_count :
5341 num_found = 0
5442 with open (filename , "r" ) as f :
5543 for line in f :
5846 num_found += 1
5947 if major != r .group (1 ) or minor != r .group (2 ) or patch != r .group (3 ):
6048 is_ok = False
61- print (f"ERROR in { filename } : got '{ line .strip ()} ' but version should be '{ major } .{ minor } .{ patch } '" )
49+ print (
50+ f"ERROR in { filename } : got '{ line .strip ()} ' but version should be '{ major } .{ minor } .{ patch } '"
51+ )
6252 if num_found != count :
6353 is_ok = False
64- print (f"ERROR in { filename } : expected { count } occurrences but found it { num_found } times" )
54+ print (
55+ f"ERROR in { filename } : expected { count } occurrences but found it { num_found } times"
56+ )
6557
6658if not is_ok :
6759 exit (1 )
68-
0 commit comments