@@ -19,26 +19,26 @@ public void CanGetMinimumCompiledInFeatures()
1919 public void CanRetrieveValidVersionString ( )
2020 {
2121 // 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)
2323 // Example output:
24- // "0.17.0[-pre20170914123547]-deadcafe -06d772d (x86 - Threads, Https)"
24+ // "0.17.0[-beta]+gdeadcafeee.LibGit2 -06d772d (x86 - Threads, Https)"
2525
2626 string versionInfo = GlobalSettings . Version . ToString ( ) ;
2727
2828 // 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.
3130 // git2hash: '06d772d' LibGit2 library hash.
3231 // arch: 'x86' or 'x64' LibGit2 target.
3332 // 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+)*)\)$" ;
3534
3635 Assert . NotNull ( versionInfo ) ;
3736
3837 Match regexResult = Regex . Match ( versionInfo , regex ) ;
3938
4039 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." ) ;
4242 }
4343
4444 [ Fact ]
0 commit comments