Skip to content

Commit 0e78b85

Browse files
committed
Merge branch 'review-tests' into feature-improved-Split
2 parents fe95d69 + c778d72 commit 0e78b85

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+6419
-7
lines changed

.editorconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ csharp_style_var_elsewhere = false:suggestion
5151
dotnet_diagnostic.CA1001.severity = warning
5252
dotnet_diagnostic.CA1309.severity = warning
5353
dotnet_diagnostic.CA1510.severity = none
54-
csharp_style_prefer_primary_constructors = false:error
54+
csharp_style_prefer_primary_constructors = false:suggestion
5555
dotnet_diagnostic.CA1311.severity = warning
5656
dotnet_diagnostic.SYSLIB1054.severity = warning
5757
dotnet_diagnostic.CA1805.severity = suggestion
@@ -115,7 +115,7 @@ dotnet_style_object_initializer = true:suggestion
115115
dotnet_style_collection_initializer = true:suggestion
116116
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
117117
dotnet_style_prefer_conditional_expression_over_assignment = true:suggestion
118-
dotnet_style_prefer_conditional_expression_over_return = true:suggestion
118+
dotnet_style_prefer_conditional_expression_over_return = false:suggestion
119119
dotnet_style_operator_placement_when_wrapping = beginning_of_line
120120
tab_width = 4
121121
indent_size = 4

.gitattributes

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
* text=auto
2+
3+
*.cs text diff=csharp
4+
5+
*.sln text eol=crlf merge=binary
6+
*.csproj merge=binary

.github/workflows/dotnet.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ jobs:
2626
- name: Build
2727
run: dotnet build --no-restore
2828
- name: Test
29-
run: dotnet test --no-build --verbosity normal
29+
run: dotnet test --no-build --verbosity normal --filter FullyQualifiedName!~SpanExtensions.Tests.Fuzzing

SpanExtensions.sln

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ VisualStudioVersion = 17.5.33627.172
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SpanExtensions", "src\SpanExtensions.csproj", "{75DE5AFD-663E-415D-9B95-6BC513BD4A07}"
77
EndProject
8+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnitTests", "tests\unit-tests\UnitTests.csproj", "{B48A0293-A7FF-4E39-8F8D-57B6F824D70F}"
9+
EndProject
10+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FuzzingTests", "tests\fuzzing\FuzzingTests.csproj", "{63CA0F05-0019-4ED3-AD94-45A5CE4D338F}"
11+
EndProject
812
Global
913
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1014
Debug|Any CPU = Debug|Any CPU
@@ -15,6 +19,14 @@ Global
1519
{75DE5AFD-663E-415D-9B95-6BC513BD4A07}.Debug|Any CPU.Build.0 = Debug|Any CPU
1620
{75DE5AFD-663E-415D-9B95-6BC513BD4A07}.Release|Any CPU.ActiveCfg = Release|Any CPU
1721
{75DE5AFD-663E-415D-9B95-6BC513BD4A07}.Release|Any CPU.Build.0 = Release|Any CPU
22+
{B48A0293-A7FF-4E39-8F8D-57B6F824D70F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
23+
{B48A0293-A7FF-4E39-8F8D-57B6F824D70F}.Debug|Any CPU.Build.0 = Debug|Any CPU
24+
{B48A0293-A7FF-4E39-8F8D-57B6F824D70F}.Release|Any CPU.ActiveCfg = Release|Any CPU
25+
{B48A0293-A7FF-4E39-8F8D-57B6F824D70F}.Release|Any CPU.Build.0 = Release|Any CPU
26+
{63CA0F05-0019-4ED3-AD94-45A5CE4D338F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
27+
{63CA0F05-0019-4ED3-AD94-45A5CE4D338F}.Debug|Any CPU.Build.0 = Debug|Any CPU
28+
{63CA0F05-0019-4ED3-AD94-45A5CE4D338F}.Release|Any CPU.ActiveCfg = Release|Any CPU
29+
{63CA0F05-0019-4ED3-AD94-45A5CE4D338F}.Release|Any CPU.Build.0 = Release|Any CPU
1830
EndGlobalSection
1931
GlobalSection(SolutionProperties) = preSolution
2032
HideSolutionNode = FALSE

src/Extensions/Span/String/Split.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public static SpanSplitStringSplitOptionsEnumerator Split(this Span<char> source
5454
/// <param name="options">A bitwise combination of the enumeration values that specifies whether to trim results and include empty results.</param>
5555
/// <param name="countExceedingBehaviour">The handling of the instances more than count.</param>
5656
/// <returns>An instance of the ref struct <see cref="SpanSplitAnyStringSplitOptionsWithCountEnumerator"/>, which works the same way as every <see cref="IEnumerator"/> does and can be used in a foreach construct.</returns>
57-
public static SpanSplitStringSplitOptionsWithCountEnumerator Split(this Span<char> source, char delimiter, StringSplitOptions options, int count, CountExceedingBehaviour countExceedingBehaviour = CountExceedingBehaviour.AppendRemainingElements)
57+
public static SpanSplitStringSplitOptionsWithCountEnumerator Split(this Span<char> source, char delimiter, int count, StringSplitOptions options, CountExceedingBehaviour countExceedingBehaviour = CountExceedingBehaviour.AppendRemainingElements)
5858
{
5959
return new SpanSplitStringSplitOptionsWithCountEnumerator(source, delimiter, count, options, countExceedingBehaviour);
6060
}

src/Extensions/Span/String/SplitAny.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public static SpanSplitAnyStringSplitOptionsEnumerator SplitAny(this Span<char>
5353
/// <param name="count">The maximum number of sub-ReadOnlySpans to split into.</param>
5454
/// <param name="countExceedingBehaviour">The handling of the instances more than count.</param>
5555
/// <returns>An instance of the ref struct <see cref="SpanSplitAnyStringSplitOptionsWithCountEnumerator"/>, which works the same way as every <see cref="IEnumerator"/> does and can be used in a foreach construct.</returns>
56-
public static SpanSplitAnyStringSplitOptionsWithCountEnumerator SplitAny(this Span<char> source, ReadOnlySpan<char> delimiters, StringSplitOptions options, int count, CountExceedingBehaviour countExceedingBehaviour = CountExceedingBehaviour.AppendRemainingElements)
56+
public static SpanSplitAnyStringSplitOptionsWithCountEnumerator SplitAny(this Span<char> source, ReadOnlySpan<char> delimiters, int count, StringSplitOptions options, CountExceedingBehaviour countExceedingBehaviour = CountExceedingBehaviour.AppendRemainingElements)
5757
{
5858
return new SpanSplitAnyStringSplitOptionsWithCountEnumerator(source, delimiters, count, options, countExceedingBehaviour);
5959
}

src/Extensions/Span/String/SplitSequence.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public static SpanSplitSequenceStringSplitOptionsEnumerator Split(this Span<char
5656
/// <param name="options">A bitwise combination of the enumeration values that specifies whether to trim results and include empty results.</param>
5757
/// <param name="countExceedingBehaviour">The handling of the instances more than count.</param>
5858
/// <returns>An instance of the ref struct <see cref="SpanSplitSequenceStringSplitOptionsWithCountEnumerator"/>, which works the same way as every <see cref="IEnumerator"/> does and can be used in a foreach construct.</returns>
59-
public static SpanSplitSequenceStringSplitOptionsWithCountEnumerator Split(this Span<char> source, ReadOnlySpan<char> delimiter, StringSplitOptions options, int count, CountExceedingBehaviour countExceedingBehaviour = CountExceedingBehaviour.AppendRemainingElements)
59+
public static SpanSplitSequenceStringSplitOptionsWithCountEnumerator Split(this Span<char> source, ReadOnlySpan<char> delimiter, int count, StringSplitOptions options, CountExceedingBehaviour countExceedingBehaviour = CountExceedingBehaviour.AppendRemainingElements)
6060
{
6161
return new SpanSplitSequenceStringSplitOptionsWithCountEnumerator(source, delimiter, count, options, countExceedingBehaviour);
6262
}

src/SpanExtensions.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<TargetFrameworks>net8.0;net7.0;net6.0;net5.0;netstandard2.1</TargetFrameworks>
5-
<ImplicitUsings>disable</ImplicitUsings>
5+
<ImplicitUsings>disable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77
<GenerateDocumentationFile>True</GenerateDocumentationFile>
88
<Platforms>AnyCPU</Platforms>

tests/fuzzing/FuzzingTests.csproj

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFrameworks>net8.0;net7.0;net6.0;net5.0</TargetFrameworks>
5+
<LangVersion>latest</LangVersion>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
9+
<IsPackable>false</IsPackable>
10+
<IsTestProject>true</IsTestProject>
11+
12+
<RootNamespace>SpanExtensions.Tests.Fuzzing</RootNamespace>
13+
</PropertyGroup>
14+
15+
<ItemGroup>
16+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
17+
<PackageReference Include="xunit" Version="2.7.0" />
18+
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
19+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
20+
<PrivateAssets>all</PrivateAssets>
21+
</PackageReference>
22+
<PackageReference Include="coverlet.collector" Version="6.0.1">
23+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
24+
<PrivateAssets>all</PrivateAssets>
25+
</PackageReference>
26+
</ItemGroup>
27+
28+
<ItemGroup>
29+
<ProjectReference Include="..\..\src\SpanExtensions.csproj" />
30+
</ItemGroup>
31+
32+
<ItemGroup>
33+
<Using Include="Xunit" />
34+
</ItemGroup>
35+
36+
</Project>

0 commit comments

Comments
 (0)