Skip to content

Commit

Permalink
redundant namespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp committed May 16, 2024
1 parent 9dad2a6 commit 942f581
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
namespace VerifyMSTest.SourceGenerator.Tests;

readonly record struct GeneratorDriverResults(GeneratorDriverResult FirstRun, GeneratorDriverResult CachedRun);

readonly record struct GeneratorDriverResult(GeneratorDriverRunResult RunResult, GeneratorDriverTimingInfo TimingInfo);
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
namespace VerifyMSTest.SourceGenerator.Tests;

static class GeneratorDriverRunResultExtensions
{
public static (string HintName, string SourceText)? SelectGeneratedSources(this GeneratorDriverRunResult gdrr) =>
gdrr
public static (string HintName, string SourceText)? SelectGeneratedSources(this GeneratorDriverRunResult runResult) =>
runResult
.Results
.SelectMany(grr => grr.GeneratedSources)
.Select(gs => (gs.HintName, gs.SourceText.ToString()))
.SelectMany(_ => _.GeneratedSources)
.Select(_ => (_.HintName, _.SourceText.ToString()))
.SingleOrDefault();

public static Dictionary<string, ImmutableArray<IncrementalGeneratorRunStep>> GetTrackedSteps(this GeneratorDriverRunResult runResult, IReadOnlyCollection<string> trackingNames) =>
runResult
.Results
.SelectMany(result => result.TrackedSteps)
.Where(step => trackingNames.Contains(step.Key))
.ToDictionary(x => x.Key, x => x.Value);
.SelectMany(_ => _.TrackedSteps)
.Where(_ => trackingNames.Contains(_.Key))
.ToDictionary(_ => _.Key, _ => _.Value);
}
5 changes: 3 additions & 2 deletions src/Verify.MSTest.SourceGenerator.Tests/Tests.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
namespace VerifyMSTest.SourceGenerator.Tests;

// These tests don't use Verify.SourceGenerator to avoid creating a circular dependency between the repos.

using VerifyMSTest.SourceGenerator;
using VerifyMSTest.SourceGenerator.Tests;

public class Tests(ITestOutputHelper output)
{
readonly UsesVerifyTestDriver testDriver = new();
Expand Down

0 comments on commit 942f581

Please sign in to comment.