File tree Expand file tree Collapse file tree 2 files changed +13
-7
lines changed
utils/swift_build_support Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ def type_clang_compiler_version(string):
78
78
79
79
Support only "MAJOR.MINOR.PATCH" format.
80
80
"""
81
- m = re .match (r'([0-9]* )\.([0-9]* )\.([0-9]*) ' , string )
81
+ m = re .match (r'^ ([0-9]+ )\.([0-9]+ )\.([0-9]+)$ ' , string )
82
82
if m is not None :
83
83
return m .group (1 , 2 , 3 )
84
84
raise argparse .ArgumentTypeError (
Original file line number Diff line number Diff line change @@ -50,12 +50,18 @@ def test_clang_compiler_version(self):
50
50
argparse .ArgumentTypeError ,
51
51
argtype .clang_compiler_version ,
52
52
"1.beta2.3" )
53
- self .assertEqual (
54
- argtype .clang_compiler_version ("1.2.preview3" ),
55
- ("1" , "2" , "" ))
56
- self .assertEqual (
57
- argtype .clang_compiler_version ("1.2.3-rc4" ),
58
- ("1" , "2" , "3" ))
53
+ self .assertRaises (
54
+ argparse .ArgumentTypeError ,
55
+ argtype .clang_compiler_version ,
56
+ "1.2.preview3" )
57
+ self .assertRaises (
58
+ argparse .ArgumentTypeError ,
59
+ argtype .clang_compiler_version ,
60
+ "1.2.3-rc4" )
61
+ self .assertRaises (
62
+ argparse .ArgumentTypeError ,
63
+ argtype .clang_compiler_version ,
64
+ "1..2" )
59
65
60
66
def test_executable (self ):
61
67
python = sys .executable
You can’t perform that action at this time.
0 commit comments