@@ -19,25 +19,25 @@ public void CanGetMinimumCompiledInFeatures()
19
19
public void CanRetrieveValidVersionString ( )
20
20
{
21
21
// 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)
23
23
// 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)"
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.]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+)*)\)$" ;
34
34
35
35
Assert . NotNull ( versionInfo ) ;
36
36
37
37
Match regexResult = Regex . Match ( versionInfo , regex ) ;
38
38
39
39
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). " +
41
41
"But found \" " + versionInfo + "\" instead." ) ;
42
42
}
43
43
0 commit comments