Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ jobs:
BUILDVAR_NuGetPublishSource: "${{ startsWith(github.ref, 'refs/tags/') && 'https://api.nuget.org/v3/index.json' || format('https://nuget.pkg.github.com/{0}/index.json', github.repository_owner) }}"
secretsYaml: |
NUGET_API_KEY: "${{ startsWith(github.ref, 'refs/tags/') && secrets.NUGET_APIKEY || secrets.BUILD_PUBLISHER_PAT }}"
secretsEncryptionKey: ${{ secrets.SHARED_WORKFLOW_KEY }}

build:
needs: prepareConfig
Expand All @@ -73,4 +74,5 @@ jobs:
# compilePhaseSecrets: ${{ needs.prepareConfig.outputs.RESOLVED_SECRETS }}
# testPhaseSecrets: ${{ needs.prepareConfig.outputs.RESOLVED_SECRETS }}
# packagePhaseSecrets: ${{ needs.prepareConfig.outputs.RESOLVED_SECRETS }}
publishPhaseSecrets: ${{ needs.prepareConfig.outputs.RESOLVED_SECRETS }}
publishPhaseSecrets: ${{ needs.prepareConfig.outputs.RESOLVED_SECRETS }}
secretsEncryptionKey: ${{ secrets.SHARED_WORKFLOW_KEY }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -397,3 +397,5 @@ FodyWeavers.xsd
# JetBrains Rider
*.sln.iml
/Solutions/Corvus.HighPerformance.v3.ncrunchsolution

*.feature.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net481'">
<ReqnrollFeatureFiles Remove="ValueStringBuilderFeatures/Net80/*.feature" />
<Compile Remove="ValueStringBuilderFeatures/Net80/*.feature.cs" />
</ItemGroup>

<PropertyGroup>
<!--
SA1602, CS1591: Doc all the things! Not appropriate for test projects.
Expand All @@ -36,10 +41,10 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.5.0" />
<PackageReference Include="MSTest.TestFramework" Version="3.5.0" />
<PackageReference Include="Reqnroll.MsTest" Version="2.0.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="MSTest.TestAdapter" Version="3.6.0" />
<PackageReference Include="MSTest.TestFramework" Version="3.6.0" />
<PackageReference Include="Reqnroll.MsTest" Version="2.1.0" />
</ItemGroup>

<ItemGroup>
Expand All @@ -50,4 +55,8 @@
<Using Include="Microsoft.VisualStudio.TestTools.UnitTesting" />
</ItemGroup>

<ItemGroup>
<Folder Include="ValueStringBuilderFeatures\Net80\" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ Scenario Outline: Grows
When I get the string from the ValueStringBuilder via '<GetStringMechanism>'
Then the ValueStringBuilder string should be '<FirstValue><SecondValue>'
Examples:
| InitializationType | InitialLength | FirstValue | SecondValue | GetStringMechanism |
| Span | 11 | Hello, world! | It is mighty fine to see you today. | ToString |
| Capacity | 11 | Hello, world! | It is mighty fine to see you today. | ToString |
| Span | 11 | Hello, world! | It is mighty fine to see you today. | GetRentedBuffer |
| Capacity | 11 | Hello, world! | It is mighty fine to see you today. | GetRentedBuffer |
| InitializationType | InitialLength | FirstValue | SecondValue | GetStringMechanism |
| Span | 11 | Hello, world! | It is mighty fine to see you today. | CreateStringAndDispose |
| Capacity | 11 | Hello, world! | It is mighty fine to see you today. | CreateStringAndDispose |
| Span | 11 | Hello, world! | It is mighty fine to see you today. | RentedBuffer |
| Capacity | 11 | Hello, world! | It is mighty fine to see you today. | RentedBuffer |

Scenario Outline: Append number
Given a ValueStringBuilder initialized with '<InitializationType>' of length <InitialLength>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
Feature: Retrieve a Memory from a ValueStringBuilder

Scenario Outline: Retrieve a Memory from a ValueStringBuilder
Given a ValueStringBuilder initialized with '<InitializationType>' of length <InitialLength>
And I append 'Hello' to the ValueStringBuilder
And I append 'World!' to the ValueStringBuilder
When I get the Memory from the ValueStringBuilder
Then the ValueStringBuilder string should be 'HelloWorld!'
Examples:
| InitializationType | InitialLength |
| Span | 10 |
| Capacity | 10 |
| Span | 11 |
| Capacity | 11 |
| Span | 20 |
| Capacity | 20 |

Scenario Outline: Retrieve a Memory with a start position from a ValueStringBuilder
Given a ValueStringBuilder initialized with '<InitializationType>' of length <InitialLength>
And I append 'Hello' to the ValueStringBuilder
And I append 'World!' to the ValueStringBuilder
When I get the Memory starting at <Start> from the ValueStringBuilder
Then the ValueStringBuilder string should be '<ExpectedValue>'
Examples:
| InitializationType | InitialLength | Start | ExpectedValue |
| Span | 10 | 0 | HelloWorld! |
| Capacity | 10 | 0 | HelloWorld! |
| Span | 20 | 0 | HelloWorld! |
| Capacity | 20 | 0 | HelloWorld! |
| Span | 10 | 3 | loWorld! |
| Capacity | 10 | 3 | loWorld! |
| Span | 20 | 3 | loWorld! |
| Capacity | 20 | 3 | loWorld! |


Scenario Outline: Retrieve a Memory with a start position and length from a ValueStringBuilder
Given a ValueStringBuilder initialized with '<InitializationType>' of length <InitialLength>
And I append 'Hello' to the ValueStringBuilder
And I append 'World!' to the ValueStringBuilder
When I get the Memory starting at <Start> with length <Length> from the ValueStringBuilder
Then the ValueStringBuilder string should be '<ExpectedValue>'
Examples:
| InitializationType | InitialLength | Start | Length | ExpectedValue |
| Span | 10 | 0 | 11 | HelloWorld! |
| Capacity | 10 | 0 | 11 | HelloWorld! |
| Span | 20 | 0 | 11 | HelloWorld! |
| Capacity | 20 | 0 | 11 | HelloWorld! |
| Span | 10 | 0 | 0 | |
| Capacity | 10 | 0 | 0 | |
| Span | 20 | 0 | 0 | |
| Capacity | 20 | 0 | 0 | |
| Span | 10 | 5 | 0 | |
| Capacity | 10 | 5 | 0 | |
| Span | 20 | 5 | 0 | |
| Capacity | 20 | 5 | 0 | |
| Span | 10 | 3 | 8 | loWorld! |
| Capacity | 10 | 3 | 8 | loWorld! |
| Span | 20 | 3 | 8 | loWorld! |
| Capacity | 20 | 3 | 8 | loWorld! |
| Span | 10 | 3 | 3 | loW |
| Capacity | 10 | 3 | 3 | loW |
| Span | 20 | 3 | 3 | loW |
| Capacity | 20 | 3 | 3 | loW |
| Span | 10 | 10 | 1 | ! |
| Capacity | 10 | 10 | 1 | ! |
| Span | 20 | 10 | 1 | ! |
| Capacity | 20 | 10 | 1 | ! |
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
Feature: Retrieve a Span from a ValueStringBuilder

Scenario Outline: Retrieve a Span from a ValueStringBuilder
Given a ValueStringBuilder initialized with '<InitializationType>' of length <InitialLength>
And I append 'Hello' to the ValueStringBuilder
And I append 'World!' to the ValueStringBuilder
When I get the Span from the ValueStringBuilder
Then the ValueStringBuilder string should be 'HelloWorld!'
Examples:
| InitializationType | InitialLength |
| Span | 10 |
| Capacity | 10 |
| Span | 11 |
| Capacity | 11 |
| Span | 20 |
| Capacity | 20 |

Scenario Outline: Retrieve a Span with a start position from a ValueStringBuilder
Given a ValueStringBuilder initialized with '<InitializationType>' of length <InitialLength>
And I append 'Hello' to the ValueStringBuilder
And I append 'World!' to the ValueStringBuilder
When I get the Span starting at <Start> from the ValueStringBuilder
Then the ValueStringBuilder string should be '<ExpectedValue>'
Examples:
| InitializationType | InitialLength | Start | ExpectedValue |
| Span | 10 | 0 | HelloWorld! |
| Capacity | 10 | 0 | HelloWorld! |
| Span | 20 | 0 | HelloWorld! |
| Capacity | 20 | 0 | HelloWorld! |
| Span | 10 | 3 | loWorld! |
| Capacity | 10 | 3 | loWorld! |
| Span | 20 | 3 | loWorld! |
| Capacity | 20 | 3 | loWorld! |


Scenario Outline: Retrieve a Span with a start position and length from a ValueStringBuilder
Given a ValueStringBuilder initialized with '<InitializationType>' of length <InitialLength>
And I append 'Hello' to the ValueStringBuilder
And I append 'World!' to the ValueStringBuilder
When I get the Span starting at <Start> with length <Length> from the ValueStringBuilder
Then the ValueStringBuilder string should be '<ExpectedValue>'
Examples:
| InitializationType | InitialLength | Start | Length | ExpectedValue |
| Span | 10 | 0 | 11 | HelloWorld! |
| Capacity | 10 | 0 | 11 | HelloWorld! |
| Span | 20 | 0 | 11 | HelloWorld! |
| Capacity | 20 | 0 | 11 | HelloWorld! |
| Span | 10 | 0 | 0 | |
| Capacity | 10 | 0 | 0 | |
| Span | 20 | 0 | 0 | |
| Capacity | 20 | 0 | 0 | |
| Span | 10 | 5 | 0 | |
| Capacity | 10 | 5 | 0 | |
| Span | 20 | 5 | 0 | |
| Capacity | 20 | 5 | 0 | |
| Span | 10 | 3 | 8 | loWorld! |
| Capacity | 10 | 3 | 8 | loWorld! |
| Span | 20 | 3 | 8 | loWorld! |
| Capacity | 20 | 3 | 8 | loWorld! |
| Span | 10 | 3 | 3 | loW |
| Capacity | 10 | 3 | 3 | loW |
| Span | 20 | 3 | 3 | loW |
| Capacity | 20 | 3 | 3 | loW |
| Span | 10 | 10 | 1 | ! |
| Capacity | 10 | 10 | 1 | ! |
| Span | 20 | 10 | 1 | ! |
| Capacity | 20 | 10 | 1 | ! |
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Feature: Append CompositeFormat into a ValueStringBuilder

Scenario Outline: Append composite format
Given a ValueStringBuilder initialized with '<InitializationType>' of length <InitialLength>
And I append the format '<CompositeFormat>' to the ValueStringBuilder with arguments <FirstValue> and '<SecondValue>'
When I get the string from the ValueStringBuilder
Then the ValueStringBuilder string should be '<Result>'
Examples:
| InitializationType | InitialLength | CompositeFormat | FirstValue | SecondValue | Result |
| Span | 34 | Number: {0}, string: {1}. | 42 | Hello, world! | Number: 42, string: Hello, world!. |
| Span | 26 | {0}, string: {1}. | 42 | Hello, world! | 42, string: Hello, world!. |
| Span | 33 | Number: {0}, string: {1} | 42 | Hello, world! | Number: 42, string: Hello, world! |
| Span | 15 | {0}{1} | 42 | Hello, world! | 42Hello, world! |
| Span | 15 | {1}{0} | 42 | Hello, world! | Hello, world!42 |
| Capacity | 34 | Number: {0}, string: {1}. | 42 | Hello, world! | Number: 42, string: Hello, world!. |
| Capacity | 26 | {0}, string: {1}. | 42 | Hello, world! | 42, string: Hello, world!. |
| Capacity | 33 | Number: {0}, string: {1} | 42 | Hello, world! | Number: 42, string: Hello, world! |
| Capacity | 15 | {0}{1} | 42 | Hello, world! | 42Hello, world! |
| Capacity | 15 | {1}{0} | 42 | Hello, world! | Hello, world!42 |
| Span | 34 | Number: {0}, string: {1}. | 42 | Hello, world! | Number: 42, string: Hello, world!. |
| Capacity | 34 | Number: {0}, string: {1}. | 42 | Hello, world! | Number: 42, string: Hello, world!. |
| Span | 35 | Number: {0}, string: {1}. | -42 | Hello, world! | Number: -42, string: Hello, world!. |
| Capacity | 35 | Number: {0}, string: {1}. | -42 | Hello, world! | Number: -42, string: Hello, world!. |
Loading
Loading