ANcpLua.Roslyn.Utilities.Testing
1.2.8
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package ANcpLua.Roslyn.Utilities.Testing --version 1.2.8
NuGet\Install-Package ANcpLua.Roslyn.Utilities.Testing -Version 1.2.8
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ANcpLua.Roslyn.Utilities.Testing" Version="1.2.8" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ANcpLua.Roslyn.Utilities.Testing" Version="1.2.8" />
<PackageReference Include="ANcpLua.Roslyn.Utilities.Testing" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ANcpLua.Roslyn.Utilities.Testing --version 1.2.8
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: ANcpLua.Roslyn.Utilities.Testing, 1.2.8"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ANcpLua.Roslyn.Utilities.Testing@1.2.8
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ANcpLua.Roslyn.Utilities.Testing&version=1.2.8
#tool nuget:?package=ANcpLua.Roslyn.Utilities.Testing&version=1.2.8
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
ANcpLua.Roslyn.Utilities
Utilities for building Roslyn incremental source generators with proper caching.
dotnet add package ANcpLua.Roslyn.Utilities # netstandard2.0
dotnet add package ANcpLua.Roslyn.Utilities.Testing # net10.0
Key APIs
EquatableArray<T>
Value-equal array wrapper — essential for generator caching (ImmutableArray uses reference equality):
// Pipeline outputs need value equality for caching to work
context.SyntaxProvider
.ForAttributeWithMetadataName("MyAttribute", ...)
.Select((ctx, _) => new MyModel { Items = GetItems(ctx).AsEquatableArray() });
Pipeline Extensions
// Simplified attribute filtering for classes/records
var provider = context.SyntaxProvider
.ForAttributeWithMetadataNameOfClassesAndRecords("MyNamespace.MyAttribute");
// Add sources with automatic file naming
provider.Select(GenerateFile).AddSource(context);
// Collect with proper caching
var collected = provider.CollectAsEquatableArray();
Testing
// Verify generated output
await source.ShouldGenerate<MyGenerator>("Output.g.cs", expectedContent);
// Verify diagnostics
await source.ShouldHaveDiagnostics<MyGenerator>(
Diagnostic("GEN001", DiagnosticSeverity.Error));
// Validate caching (catches forbidden types: ISymbol, Compilation, SyntaxNode, etc.)
await source.ShouldBeCached<MyGenerator>();
Related
- ANcpLua.Analyzers — Analyzers using these utilities
- ANcpLua.NET.Sdk — MSBuild SDK with embedded source generator helpers
License
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- ANcpLua.Roslyn.Utilities (>= 1.2.8)
- AwesomeAssertions (>= 9.3.0)
- Basic.Reference.Assemblies.Net100 (>= 1.8.4)
- Microsoft.CodeAnalysis.Analyzer.Testing (>= 1.1.3-beta1.24423.1)
- Microsoft.CodeAnalysis.CSharp (>= 5.0.0)
- Microsoft.CodeAnalysis.CSharp.SourceGenerators.Testing (>= 1.1.3-beta1.24423.1)
- Microsoft.CodeAnalysis.CSharp.Workspaces (>= 5.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.13.0 | 71 | 1/18/2026 |
| 1.12.0 | 102 | 1/14/2026 |
| 1.11.0 | 37 | 1/14/2026 |
| 1.10.0 | 174 | 1/10/2026 |
| 1.9.0 | 43 | 1/10/2026 |
| 1.8.0 | 43 | 1/10/2026 |
| 1.7.0 | 86 | 1/10/2026 |
| 1.6.0 | 43 | 1/9/2026 |
| 1.5.1 | 44 | 1/9/2026 |
| 1.5.0 | 45 | 1/8/2026 |
| 1.3.1 | 55 | 12/30/2025 |
| 1.2.8 | 48 | 12/30/2025 |
| 1.2.7 | 48 | 12/30/2025 |
| 1.2.6 | 40 | 12/30/2025 |
| 1.2.4 | 43 | 12/30/2025 |
| 1.2.2 | 43 | 12/29/2025 |
| 1.2.1 | 45 | 12/29/2025 |
| 1.2.0 | 147 | 12/24/2025 |
| 1.0.0 | 106 | 12/20/2025 |