Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
meziantou committed May 21, 2024
1 parent 3395938 commit e3c412b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis" Version="4.9.2" />
<PackageReference Include="Microsoft.CodeAnalysis" Version="4.8.0" />
</ItemGroup>

<ItemGroup>
Expand Down
8 changes: 4 additions & 4 deletions Meziantou.Polyfill.SourceGenerator.Tests/UnitTest1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public void PolyfillOptions_Included()

Assert.False(options.Include("T:C"));
}

[Fact]
public void PolyfillOptions_Excluded()
{
Expand Down Expand Up @@ -55,7 +55,7 @@ public async Task ExcludedPolyfill()
result = GenerateFiles("", assemblyLocations: assemblies, excludedPolyfills: "T:System.Diagnostics.CodeAnalysis.UnscopedRefAttribute");
Assert.Empty(result.GeneratorResult.GeneratedTrees.Where(t => t.FilePath.Contains("UnscopedRefAttribute")));
}

[Fact]
public async Task IncludedPolyfill_Methods()
{
Expand Down Expand Up @@ -225,7 +225,7 @@ private static (GeneratorDriverRunResult GeneratorResult, Compilation OutputComp
{
["build_property.MeziantouPolyfill_IncludedPolyfills"] = includedPolyfills,
["build_property.MeziantouPolyfill_ExcludedPolyfills"] = excludedPolyfills,
}),
}),
parseOptions: parseOptions);

driver = driver.RunGeneratorsAndUpdateCompilation(compilation, out var outputCompilation, out var diagnostics);
Expand All @@ -239,7 +239,7 @@ private static (GeneratorDriverRunResult GeneratorResult, Compilation OutputComp
if (mustCompile)
{
var tree = runResult.GeneratedTrees.FirstOrDefault(tree => tree.FilePath == "Meziantou.Polyfill\\Meziantou.Polyfill.PolyfillGenerator\\Debug.g.cs");
var diags = string.Join("\n", result.Diagnostics);
var diags = string.Join("\n", result.Diagnostics.Where(diag => !diag.IsSuppressed));
Assert.True(result.Success, "Compilation error:\n" + diags + "\n" + tree);
Assert.Empty(result.Diagnostics);
}
Expand Down

0 comments on commit e3c412b

Please sign in to comment.