Skip to content

Commit

Permalink
Fixup the analyzer tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jmarolf committed Aug 25, 2021
1 parent 2b74021 commit 3700694
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<PackageVersion Include="Microsoft.Build.Framework" Version="$(MicrosoftBuildVersion)" />
<PackageVersion Include="Microsoft.Build.Locator" Version="1.4.1" />
<PackageVersion Include="Microsoft.Build" Version="$(MicrosoftBuildVersion)"/>
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzer.Testing" Version="1.0.1-beta1.20413.3" />
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzer.Testing" Version="1.1.1-beta1.21413.1" />
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.2" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Features" Version="$(MicrosoftNETCoreCompilersPackageVersion)" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="$(MicrosoftNETCoreCompilersPackageVersion)" />
Expand Down
2 changes: 1 addition & 1 deletion src/dotnet-format.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp6.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<OutputType>Exe</OutputType>
<LangVersion>9.0</LangVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
Expand Down
12 changes: 6 additions & 6 deletions tests/Analyzers/AnalyzerAssemblyGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ private static async Task<IEnumerable<MetadataReference>> GetReferencesAsync()
{
var references = new List<MetadataReference>()
{
MetadataReference.CreateFromFile(Path.Combine(s_basePath, Path.GetFileName(typeof(ImmutableArray).Assembly.Location))),
MetadataReference.CreateFromFile(Path.Combine(s_basePath, Path.GetFileName(typeof(SharedAttribute).Assembly.Location))),
MetadataReference.CreateFromFile(Path.Combine(s_basePath, Path.GetFileName(typeof(CSharpCompilation).Assembly.Location))),
MetadataReference.CreateFromFile(Path.Combine(s_basePath, Path.GetFileName(typeof(DiagnosticAnalyzer).Assembly.Location))),
MetadataReference.CreateFromFile(Path.Combine(s_basePath, Path.GetFileName(typeof(CodeFixProvider).Assembly.Location))),
MetadataReference.CreateFromFile(typeof(ImmutableArray).Assembly.Location),
MetadataReference.CreateFromFile(typeof(SharedAttribute).Assembly.Location),
MetadataReference.CreateFromFile(typeof(CSharpCompilation).Assembly.Location),
MetadataReference.CreateFromFile(typeof(DiagnosticAnalyzer).Assembly.Location),
MetadataReference.CreateFromFile(typeof(CodeFixProvider).Assembly.Location),
};

var netcoreMetadataReferences = await ReferenceAssemblies.NetCore.NetCoreApp31.ResolveAsync(LanguageNames.CSharp, CancellationToken.None);
var netcoreMetadataReferences = await ReferenceAssemblies.Net.Net60.ResolveAsync(LanguageNames.CSharp, CancellationToken.None);
references.AddRange(netcoreMetadataReferences.Where(reference => Path.GetFileName(reference.Display) != "System.Collections.Immutable.dll"));

return references;
Expand Down
2 changes: 1 addition & 1 deletion tests/Formatters/AbstractFormatterTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ static AbstractFormatterTest()

protected AbstractFormatterTest()
{
TestState = new SolutionState(DefaultFilePathPrefix, DefaultFileExt);
TestState = new SolutionState("Test", Language, DefaultFilePathPrefix, DefaultFileExt);
}

/// <summary>
Expand Down

0 comments on commit 3700694

Please sign in to comment.