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
2 changes: 1 addition & 1 deletion .github/workflows/Format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
if: ${{ needs.discover.result == 'success' }}
uses: Stillpoint-Software/shared-workflows/.github/workflows/format.yml@main
with:
dotnet_version: "9.0.x"
dotnet_version: "10.0.x"
branch: ${{ needs.discover.outputs.branch_name }}
secrets: inherit

2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<!-- Shared package refs -->
<ItemGroup>
<!-- NBGV drives versions; PrivateAssets=all keeps it out of consumers -->
<PackageReference Include="Nerdbank.GitVersioning" Version="3.8.38-alpha" PrivateAssets="all" />
<PackageReference Include="Nerdbank.GitVersioning" Version="3.9.50" PrivateAssets="all" />

<!-- SourceLink for GitHub -->
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0">
Expand Down
77 changes: 0 additions & 77 deletions Hyperbee.Collections.sln

This file was deleted.

28 changes: 28 additions & 0 deletions Hyperbee.Collections.slnx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<Solution>
<Folder Name="/Solution Items/">
<File Path="Directory.Build.props" />
<File Path="LICENSE" />
<File Path="README.md" />
<File Path="version.json" />
<Project Path="docs/docs.shproj" />
</Folder>
<Folder Name="/Solution Items/.github/">
<File Path=".github/dependabot.yml" />
<File Path=".github/issue-branch.yml" />
</Folder>
<Folder Name="/Solution Items/.github/workflows/">
<File Path=".github/workflows/create_release.yml" />
<File Path=".github/workflows/create_test_report.yml" />
<File Path=".github/workflows/deploy-gh-pages.yml" />
<File Path=".github/workflows/format.yml" />
<File Path=".github/workflows/issue_branch.yml" />
<File Path=".github/workflows/pack_publish.yml" />
<File Path=".github/workflows/run_tests.yml" />
<File Path=".github/workflows/unlist_package.yml" />
</Folder>
<Folder Name="/Solution Tests/">
<Project Path="test/Hyperbee.Collections.Benchmark/Hyperbee.Collections.Benchmark.csproj" />
<Project Path="test/Hyperbee.Collections.Tests/Hyperbee.Collections.Tests.csproj" />
</Folder>
<Project Path="src/Hyperbee.Collections/Hyperbee.Collections.csproj" />
</Solution>
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,11 @@ for more details.
| `develop` | [![Build status](https://github.com/Stillpoint-Software/Hyperbee.Collections/actions/workflows/pack_publish.yml/badge.svg?branch=develop)](https://github.com/Stillpoint-Software/Hyperbee.Collections/actions/workflows/pack_publish.yml) |
| `main` | [![Build status](https://github.com/Stillpoint-Software/Hyperbee.Collections/actions/workflows/pack_publish.yml/badge.svg)](https://github.com/Stillpoint-Software/Hyperbee.Collections/actions/workflows/pack_publish.yml) |


# Benchmarks
See [Benchmarks](https://github.com/Stillpoint-Software/Hyperbee.Collections/test/Hyperbee.Collections.Benchmark/benchmark/results/Hyperbee.Collections.Benchmark.CollectionsBenchmark-report-github.md)


# Help
See [Todo](https://github.com/Stillpoint-Software/Hyperbee.Collections/blob/main/docs/todo.md)

Expand Down
5 changes: 4 additions & 1 deletion src/Hyperbee.Collections/Hyperbee.Collections.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<TargetFrameworks>net8.0;net10.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>disable</Nullable>
<IsPackable>true</IsPackable>
Expand Down Expand Up @@ -33,10 +33,13 @@
<None Include="..\..\assets\icon.png" Pack="true" Visible="false" PackagePath="/" />
<None Include="..\..\README.md" Pack="true" Visible="true" PackagePath="/" Link="README.md" />
<None Include="..\..\LICENSE" Pack="true" Visible="false" PackagePath="/" />
<PackageReference Update="Microsoft.CodeAnalysis.CSharp.Scripting" Version="4.14.0" />

<PackageReference Update="Microsoft.SourceLink.GitHub" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>

<PackageReference Update="Nerdbank.GitVersioning" Version="3.9.50" />
</ItemGroup>
</Project>
1 change: 1 addition & 0 deletions test/Hyperbee.Collections.Benchmark/BenchmarkConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using BenchmarkDotNet.Validators;

namespace Hyperbee.Collections.Benchmark;

public class BenchmarkConfig
{
public class Config : ManualConfig
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#pragma warning disable CA1806

namespace Hyperbee.Collections.Benchmark;

public class CollectionsBenchmark
{
private const char Separator = ',';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,22 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.14.0" />
<PackageReference Include="BenchmarkDotNet" Version="0.15.8" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\Hyperbee.Collections\Hyperbee.Collections.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="Microsoft.CodeAnalysis.CSharp.Scripting" Version="4.14.0" />
<PackageReference Update="Nerdbank.GitVersioning" Version="3.9.50" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
```

BenchmarkDotNet v0.14.0, Windows 11 (10.0.26100.2033)
12th Gen Intel Core i9-12900HK, 1 CPU, 20 logical and 14 physical cores
.NET SDK 9.0.100
[Host] : .NET 9.0.0 (9.0.24.52809), X64 RyuJIT AVX2 DEBUG
ShortRun : .NET 9.0.0 (9.0.24.52809), X64 RyuJIT AVX2
BenchmarkDotNet v0.15.8, Windows 11 (10.0.26200.7462/25H2/2025Update/HudsonValley2)
12th Gen Intel Core i9-12900HK 2.50GHz, 1 CPU, 20 logical and 14 physical cores
.NET SDK 10.0.101
[Host] : .NET 10.0.1 (10.0.1, 10.0.125.57005), X64 RyuJIT x86-64-v3 DEBUG
ShortRun : .NET 10.0.1 (10.0.1, 10.0.125.57005), X64 RyuJIT x86-64-v3

Job=ShortRun IterationCount=3 LaunchCount=1
WarmupCount=3

```
| Method | List | Mean | Error | StdDev | Gen0 | Gen1 | Allocated |
|------------------------- |---------------- |---------:|----------:|----------:|-------:|-------:|----------:|
| LinkedDirectorySelectAll | aa1,bb1,cc1,dd1 | 1.990 μs | 0.6392 μs | 0.0350 μs | 0.4425 | 0.0038 | 5.45 KB |
| LinkedDirectorySelectAll | aa2,bb2,cc2,dd2 | 2.061 μs | 1.0472 μs | 0.0574 μs | 0.4425 | 0.0038 | 5.45 KB |
| LinkedDirectorySelectAll | aa2,bb2,cc2,dd2 | 1.781 μs | 0.2390 μs | 0.0131 μs | 0.4444 | 0.0038 | 5.46 KB |
| LinkedDirectorySelectAll | aa1,bb1,cc1,dd1 | 1.880 μs | 0.7184 μs | 0.0394 μs | 0.4444 | 0.0038 | 5.46 KB |
19 changes: 7 additions & 12 deletions test/Hyperbee.Collections.Tests/AhoCorasickTests.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Hyperbee.Collections.Tests;
namespace Hyperbee.Collections.Tests;

[TestClass]
public class AhoCorasickTests
Expand All @@ -24,7 +19,7 @@ public void Should_find_entries()

var matches = trie.Find( haystack ).ToArray();

Assert.AreEqual( 9, matches.Length );
Assert.HasCount( 9, matches );

Assert.IsTrue( "all" == Match( matches[0], haystack ) && 0 == matches[0].Index );
Assert.IsTrue( "base" == Match( matches[1], haystack ) && 11 == matches[1].Index );
Expand All @@ -51,7 +46,7 @@ public void Should_find_selected_entries()

var matches = trie.Find( haystack ).Where( x => x.Overlap == 0 ).ToArray();

Assert.AreEqual( 4, matches.Length );
Assert.HasCount( 4, matches );

Assert.IsTrue( "all" == Match( matches[0], haystack ) && 0 == matches[0].Index );
Assert.IsTrue( "bbaselless" == Match( matches[1], haystack ) && 10 == matches[1].Index );
Expand Down Expand Up @@ -82,7 +77,7 @@ public void Should_find_selected1_entries()
} )
.ToArray();

Assert.AreEqual( 3, matches.Length );
Assert.HasCount( 3, matches );

Assert.IsTrue( Match( matches[0], haystack ) == "Base" && "key_base" == matches[0].Tag && 9 == matches[0].Index );
Assert.IsTrue( Match( matches[1], haystack ) == "tent" && "key_tent" == matches[1].Tag && 41 == matches[1].Index );
Expand All @@ -99,7 +94,7 @@ public void Should_find_caseinsensistive_entries()

var matches = trie.Find( haystack ).ToArray();

Assert.AreEqual( 2, matches.Length );
Assert.HasCount( 2, matches );
}

[TestMethod]
Expand All @@ -116,7 +111,7 @@ public void Should_return_associated_value()
var matches = trie.Find( haystack );
var lines = matches.Select( x => x.Tag ).ToArray();

Assert.AreEqual( 2, lines.Length );
Assert.HasCount( 2, lines );
Assert.AreEqual( 1, lines[0] );
Assert.AreEqual( 0, lines[1] );
}
Expand Down Expand Up @@ -145,7 +140,7 @@ public void Should_return_projected_value()
} )
.ToArray();

Assert.AreEqual( 2, matches.Length );
Assert.HasCount( 2, matches );
Assert.AreEqual( "base", matches[0].Word );
Assert.AreEqual( guid1, matches[0].GuidTag );
Assert.AreEqual( guidRef, matches[1].GuidRef );
Expand Down
24 changes: 22 additions & 2 deletions test/Hyperbee.Collections.Tests/ArrayPool/PooledArrayTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,17 @@ public void Indexer_ShouldThrow_WhenOutOfRange()
using var array = new PooledArray<int>();

// Act & Assert
Assert.ThrowsException<ArgumentOutOfRangeException>( () => _ = array[0] );
var exception = false;
try
{
_ = array[0];
}
catch ( ArgumentOutOfRangeException )
{
exception = true;
}

Assert.IsTrue( exception, "Expected ArgumentOutOfRangeException was not thrown" );
}

[TestMethod]
Expand Down Expand Up @@ -58,7 +68,17 @@ public void Dispose_ShouldReleaseMemory()
array.Dispose();

// Assert
Assert.ThrowsException<ObjectDisposedException>( () => array.Add( 1 ) );
var exception = false;
try
{
array.Add( 1 );
}
catch ( ObjectDisposedException )
{
exception = true;
}

Assert.IsTrue( exception, "Expected ObjectDisposedException was not thrown" );
}

[TestMethod]
Expand Down
24 changes: 22 additions & 2 deletions test/Hyperbee.Collections.Tests/ArrayPool/PooledStackTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,17 @@ public void Pop_ShouldThrow_WhenStackIsEmpty()
using var stack = new PooledStack<int>();

// Act & Assert
Assert.ThrowsException<InvalidOperationException>( () => stack.Pop() );
var exception = false;
try
{
stack.Pop();
}
catch ( InvalidOperationException )
{
exception = true;
}

Assert.IsTrue( exception, "Expected InvalidOperationException was not thrown" );
}

[TestMethod]
Expand Down Expand Up @@ -86,6 +96,16 @@ public void Dispose_ShouldReleaseMemory()
stack.Dispose();

// Assert
Assert.ThrowsException<ObjectDisposedException>( () => stack.Push( 1 ) );
var exception = false;
try
{
stack.Push( 1 );
}
catch ( ObjectDisposedException )
{
exception = true;
}

Assert.IsTrue( exception, "Expected ObjectDisposedException was not thrown" );
}
}
Loading
Loading