Skip to content

Commit ad6b3e0

Browse files
committed
Fixed two issues with Regex that affect .NET 6 or less. Improved unit tests to test for .NET 5, 6 amd 7. Removed .NET 8 from list of target framewors, as this does not require any changes to .NET 7 code.
1 parent ffd21b2 commit ad6b3e0

4 files changed

Lines changed: 28 additions & 16 deletions

File tree

Solidsoft.Reply.Parsers.Gs1Ai.Tests/Solidsoft.Reply.Parsers.Gs1Ai.Tests.csproj

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
5-
<LangVersion>12.0</LangVersion>
4+
<TargetFrameworks>net7.0;net6.0;net5.0</TargetFrameworks>
5+
<LangVersion>12.0</LangVersion>
66
<Nullable>enable</Nullable>
77
<ImplicitUsings>enable</ImplicitUsings>
88
<AssemblyName>$(MSBuildProjectName)</AssemblyName>
@@ -13,6 +13,24 @@
1313
<CodeAnalysisRuleSet>$(SolutionDir)StyleCopAnalyzersDefault.ruleset</CodeAnalysisRuleSet>
1414
</PropertyGroup>
1515

16+
<ItemGroup>
17+
<Compile Remove="Drivers\**" />
18+
<Compile Remove="Properties\**" />
19+
<Compile Remove="Support\**" />
20+
<EmbeddedResource Remove="Drivers\**" />
21+
<EmbeddedResource Remove="Properties\**" />
22+
<EmbeddedResource Remove="Support\**" />
23+
<None Remove="Drivers\**" />
24+
<None Remove="Properties\**" />
25+
<None Remove="Support\**" />
26+
<ReqnrollFeatureFiles Remove="Drivers\**" />
27+
<ReqnrollFeatureFiles Remove="Properties\**" />
28+
<ReqnrollFeatureFiles Remove="Support\**" />
29+
<ReqnrollObsoleteCodeBehindFiles Remove="Drivers\**" />
30+
<ReqnrollObsoleteCodeBehindFiles Remove="Properties\**" />
31+
<ReqnrollObsoleteCodeBehindFiles Remove="Support\**" />
32+
</ItemGroup>
33+
1634
<ItemGroup>
1735
<None Remove="stylecop.json" />
1836
</ItemGroup>
@@ -22,20 +40,14 @@
2240
</ItemGroup>
2341

2442
<ItemGroup>
25-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
26-
<PackageReference Include="Reqnroll.xUnit" Version="2.2.1" />
27-
<PackageReference Include="xunit" Version="2.9.3" />
28-
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.1">
43+
<PackageReference Include="FluentAssertions" Version="[7.1.0]" />
44+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
45+
<PackageReference Include="Reqnroll.xUnit" Version="2.3.0" />
46+
<PackageReference Include="xunit" Version="2.4.2" />
47+
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
2948
<PrivateAssets>all</PrivateAssets>
3049
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3150
</PackageReference>
32-
<PackageReference Include="FluentAssertions" Version="[7.1.0]" />
33-
</ItemGroup>
34-
35-
<ItemGroup>
36-
<Folder Include="Drivers\" />
37-
<Folder Include="Properties\" />
38-
<Folder Include="Support\" />
3951
</ItemGroup>
4052

4153
<ItemGroup>

Solidsoft.Reply.Parsers.Gs1Ai/Descriptors/IbanDescriptor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class IbanDescriptor(
103103
/// <summary>
104104
/// Regular expression for Bosnia and Herzegovina IBAN.
105105
/// </summary>
106-
private static readonly Regex BosniaAndHerzegovinaIbanRegex = new (@"^BE\d{2}\d{16}$", RegexOptions.None);
106+
private static readonly Regex BosniaAndHerzegovinaIbanRegex = new (@"^BA\d{2}\d{16}$", RegexOptions.None);
107107

108108
/// <summary>
109109
/// Regular expression for Brazil IBAN.

Solidsoft.Reply.Parsers.Gs1Ai/EntityResolver.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ internal static class EntityResolver {
339339
/// <summary>
340340
/// Returns a regular expression for matching a GS1 UIC with Extension 1 and Imported index.
341341
/// </summary>
342-
private static readonly Regex Gs1UicWithExtension1AndImportedIndexRegex = new (@"^\d" + CharacterSet82 + $"{Eu2018574ImporterIndexCharacterSet}$", RegexOptions.None);
342+
private static readonly Regex Gs1UicWithExtension1AndImportedIndexRegex = new (@"^\d" + CharacterSet82 + @"{2}" + $"{Eu2018574ImporterIndexCharacterSet}$", RegexOptions.None);
343343

344344
/// <summary>
345345
/// Returns a regular expression for six-digit date representation - YYMMDD.

Solidsoft.Reply.Parsers.Gs1Ai/Solidsoft.Reply.Parsers.Gs1Ai.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net8.0;net7.0;net6.0;netstandard2.0</TargetFrameworks>
4+
<TargetFrameworks>net7.0;net6.0;netstandard2.0</TargetFrameworks>
55
<LangVersion>12.0</LangVersion>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>

0 commit comments

Comments
 (0)