@@ -19,25 +19,25 @@ public void CanGetMinimumCompiledInFeatures()
1919 public void CanRetrieveValidVersionString ( )
2020 {
2121 // Version string format is:
22- // Major.Minor.Patch[-somePreleaseTag]- libgit2_abbrev_hash (x86|x64 - features)
22+ // Major.Minor.Patch[-previewTag]+g{LibGit2Sharp_abbrev_hash}.libgit2-{ libgit2_abbrev_hash} (x86|x64 - features)
2323 // Example output:
24- // "0.17.0[-beta]+gdeadcafeee.LibGit2-06d772d (x86 - Threads, Https)"
24+ // "0.25.0-preview.52+g871d13a67f.libgit2-15e1193 (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.]LibGit2-06d772d ' LibGit2Sharp version number.
30- // git2hash : '06d772d' LibGit2 library hash.
31- // arch: 'x86' or 'x64' LibGit2 target.
32- // git2Features: 'Threads, Ssh' LibGit2 features compiled with.
33- string regex = @"^(?<version>\d+\.\d+\.\d+(-[\w\-\.]+)?\+(g(?<git2SharpHash>[a-f0-9]{10})\.)?LibGit2 -[a-f0-9]{7}) \((?<arch>\w+) - (?<git2Features>(?:\w*(?:, )*\w+)*)\)$" ;
29+ // version: '0.25 .0[-previewTag] ' LibGit2Sharp version number.
30+ // git2SharpHash : '871d13a67f' LibGit2Sharp hash.
31+ // arch: 'x86' or 'x64' libgit2 target.
32+ // git2Features: 'Threads, Ssh' libgit2 features compiled with.
33+ string regex = @"^(?<version>\d+\.\d+\.\d+(-[\w\-\.]+)?\+(g(?<git2SharpHash>[a-f0-9]{10})\.)?libgit2 -[a-f0-9]{7}) \((?<arch>\w+) - (?<git2Features>(?:\w*(?:, )*\w+)*)\)$" ;
3434
3535 Assert . NotNull ( versionInfo ) ;
3636
3737 Match regexResult = Regex . Match ( versionInfo , regex ) ;
3838
3939 Assert . True ( regexResult . Success , "The following version string format is enforced:" +
40- "Major.Minor.Patch[-somePreleaseTag]+[gSomeGitCommit].LibGit2-abbrev_hash (x86|x64 - features). " +
40+ "Major.Minor.Patch[-previewTag]+g{LibGit2Sharp_abbrev_hash}.libgit2-{libgit2_abbrev_hash} (x86|x64 - features). " +
4141 "But found \" " + versionInfo + "\" instead." ) ;
4242 }
4343
0 commit comments