@@ -23,25 +23,25 @@ public void CanGetMinimumCompiledInFeatures()
23
23
public void CanRetrieveValidVersionString ( )
24
24
{
25
25
// Version string format is:
26
- // Major.Minor.Patch[-previewTag]+{LibGit2Sharp_abbrev_hash}. libgit2-{libgit2_abbrev_hash} (x86|x64 - features)
26
+ // Major.Minor.Patch[-previewTag]+libgit2-{libgit2_abbrev_hash}.{LibGit2Sharp_hash} (arch - features)
27
27
// Example output:
28
- // "0.25 .0-preview.52+871d13a67f. libgit2-15e1193 (x86 - Threads, Https)"
28
+ // "0.27 .0-preview.0.1896+ libgit2-c058aa8.c1ac3ed74487da5fac24cf1e48dc8ea71e917b75 (x64 - Threads, Https, NSec )"
29
29
30
30
string versionInfo = GlobalSettings . Version . ToString ( ) ;
31
31
32
32
// The GlobalSettings.Version returned string should contain :
33
33
// version: '0.25.0[-previewTag]' LibGit2Sharp version number.
34
- // git2SharpHash: '871d13a67f ' LibGit2Sharp hash.
34
+ // git2SharpHash: 'c1ac3ed74487da5fac24cf1e48dc8ea71e917b75 ' LibGit2Sharp hash.
35
35
// arch: 'x86' or 'x64' libgit2 target.
36
36
// git2Features: 'Threads, Ssh' libgit2 features compiled with.
37
- string regex = @"^(?<version>\d+\.\d+\.\d+(-[\w\-\.]+)?\+((?<git2SharpHash> [a-f0-9]{10})\.)?libgit2- [a-f0-9]{7}) \((?<arch>\w+) - (?<git2Features>(?:\w*(?:, )*\w+)*)\)$" ;
37
+ string regex = @"^(?<version>\d+\.\d+\.\d+(-[\w\-\.]+)?)\+libgit2- [a-f0-9]{7}\.((?<git2SharpHash> [a-f0-9]{40}))? \((?<arch>\w+) - (?<git2Features>(?:\w*(?:, )*\w+)*)\)$" ;
38
38
39
39
Assert . NotNull ( versionInfo ) ;
40
40
41
41
Match regexResult = Regex . Match ( versionInfo , regex ) ;
42
42
43
43
Assert . True ( regexResult . Success , "The following version string format is enforced:" +
44
- "Major.Minor.Patch[-previewTag]+{LibGit2Sharp_abbrev_hash}. libgit2-{libgit2_abbrev_hash} (x86|x64 - features). " +
44
+ "Major.Minor.Patch[-previewTag]+libgit2-{libgit2_abbrev_hash}.{LibGit2Sharp_hash} (arch - features). " +
45
45
"But found \" " + versionInfo + "\" instead." ) ;
46
46
}
47
47
0 commit comments