Skip to content

Commit 2da1e0e

Browse files
committed
Update version test
1 parent 1d64999 commit 2da1e0e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Diff for: LibGit2Sharp.Tests/GlobalSettingsFixture.cs

+5-5
Original file line numberDiff line numberDiff line change
@@ -23,25 +23,25 @@ public void CanGetMinimumCompiledInFeatures()
2323
public void CanRetrieveValidVersionString()
2424
{
2525
// 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)
2727
// 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)"
2929

3030
string versionInfo = GlobalSettings.Version.ToString();
3131

3232
// The GlobalSettings.Version returned string should contain :
3333
// version: '0.25.0[-previewTag]' LibGit2Sharp version number.
34-
// git2SharpHash: '871d13a67f' LibGit2Sharp hash.
34+
// git2SharpHash: 'c1ac3ed74487da5fac24cf1e48dc8ea71e917b75' LibGit2Sharp hash.
3535
// arch: 'x86' or 'x64' libgit2 target.
3636
// 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+)*)\)$";
3838

3939
Assert.NotNull(versionInfo);
4040

4141
Match regexResult = Regex.Match(versionInfo, regex);
4242

4343
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). " +
4545
"But found \"" + versionInfo + "\" instead.");
4646
}
4747

0 commit comments

Comments
 (0)