Skip to content

Commit

Permalink
Fix version badge
Browse files Browse the repository at this point in the history
  • Loading branch information
ltrzesniewski committed Jan 20, 2024
1 parent 326f55a commit 76f3e47
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![Build](https://github.com/ltrzesniewski/pcre-net/workflows/Build/badge.svg)](https://github.com/ltrzesniewski/pcre-net/actions?query=workflow%3ABuild)
[![NuGet Package](https://img.shields.io/nuget/v/PCRE.NET.svg?logo=NuGet)](https://www.nuget.org/packages/PCRE.NET)
[![GitHub release](https://img.shields.io/github/release/ltrzesniewski/pcre-net.svg?logo=GitHub)](https://github.com/ltrzesniewski/pcre-net/releases)
[![PCRE2](https://img.shields.io/badge/pcre2-v10.43-RC1-blue.svg)](https://github.com/PCRE2Project/pcre2)
[![PCRE2](https://img.shields.io/badge/pcre2-v10.43--RC1-blue.svg)](https://github.com/PCRE2Project/pcre2)
[![License](https://img.shields.io/badge/license-BSD-blue.svg)](https://github.com/ltrzesniewski/pcre-net/blob/master/LICENCE)
<br clear="right" />

Expand Down
4 changes: 2 additions & 2 deletions src/PCRE.NET.Tests/PcreNet/DocumentationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ static string NormalizeVersion(string version)
public void should_have_correct_pcre_version_badge_in_readme()
{
var readmeText = File.ReadAllText(Path.Combine(Path.GetDirectoryName(typeof(DocumentationTests).Assembly.Location)!, "README.md"));
var match = Regex.Match(readmeText, @"https://img\.shields\.io/badge/pcre2-v(?<pcreVersion>[\d.]+(?:-RC\d+)?)-blue\.svg", RegexOptions.CultureInvariant);
var match = Regex.Match(readmeText, @"https://img\.shields\.io/badge/pcre2-v(?<pcreVersion>[\d.]+(?:--RC\d+)?)-blue\.svg", RegexOptions.CultureInvariant);

Assert.That(match.Success);
Assert.That(NormalizeVersion(match.Groups["pcreVersion"].Value), Is.EqualTo(NormalizeVersion(PcreBuildInfo.Version.Split(' ')[0])));
Assert.That(NormalizeVersion(match.Groups["pcreVersion"].Value.Replace("--", "-")), Is.EqualTo(NormalizeVersion(PcreBuildInfo.Version.Split(' ')[0])));

static string NormalizeVersion(string version)
=> Regex.Replace(version, @"(?:\.0)+$", string.Empty);
Expand Down

0 comments on commit 76f3e47

Please sign in to comment.