@@ -19,26 +19,26 @@ public void CanGetMinimumCompiledInFeatures()
19
19
public void CanRetrieveValidVersionString ( )
20
20
{
21
21
// Version string format is:
22
- // Major.Minor.Patch[-somePreleaseTag]-LibGit2Sharp_abbrev_hash- libgit2_abbrev_hash (x86|x64 - features)
22
+ // Major.Minor.Patch[-somePreleaseTag]-libgit2_abbrev_hash (x86|x64 - features)
23
23
// Example output:
24
- // "0.17.0[-pre20170914123547]-deadcafe -06d772d (x86 - Threads, Https)"
24
+ // "0.17.0[-beta]+gdeadcafeee.LibGit2 -06d772d (x86 - Threads, Https)"
25
25
26
26
string versionInfo = GlobalSettings . Version . ToString ( ) ;
27
27
28
28
// The GlobalSettings.Version returned string should contain :
29
- // version: '0.17.0[-somePreleaseTag][+gSomeGitCommit]' LibGit2Sharp version number.
30
- // git2SharpHash:'unknown' ( when compiled from source ) else LibGit2Sharp library hash.
29
+ // version: '0.17.0[-somePreleaseTag]+[gSomeGitCommit.]LibGit2-06d772d' LibGit2Sharp version number.
31
30
// git2hash: '06d772d' LibGit2 library hash.
32
31
// arch: 'x86' or 'x64' LibGit2 target.
33
32
// git2Features: 'Threads, Ssh' LibGit2 features compiled with.
34
- string regex = @"^(?<version>\d+\.\d+\.\d+(-\w+)?(\+g [a-f0-9]{10})?)-(?<git2SharpHash>\w+)-(?<git2Hash>\w+ ) \((?<arch>\w+) - (?<git2Features>(?:\w*(?:, )*\w+)*)\)$" ;
33
+ string regex = @"^(?<version>\d+\.\d+\.\d+(-\w+)?\+(g(?<git2SharpHash> [a-f0-9]{10})\.)?LibGit2-[a-f0-9]{7} ) \((?<arch>\w+) - (?<git2Features>(?:\w*(?:, )*\w+)*)\)$" ;
35
34
36
35
Assert . NotNull ( versionInfo ) ;
37
36
38
37
Match regexResult = Regex . Match ( versionInfo , regex ) ;
39
38
40
39
Assert . True ( regexResult . Success , "The following version string format is enforced:" +
41
- "Major.Minor.Patch[-somePreleaseTag][+gSomeGitCommit]-LibGit2Sharp_abbrev_hash-libgit2_abbrev_hash (x86|x64 - features)" ) ;
40
+ "Major.Minor.Patch[-somePreleaseTag]+[gSomeGitCommit].LibGit2-abbrev_hash (x86|x64 - features). " +
41
+ "But found \" " + versionInfo + "\" instead." ) ;
42
42
}
43
43
44
44
[ Fact ]
0 commit comments