mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-07-05 12:08:16 +08:00
Update dependencies
* Add support for C# 12 * Run all tests on all major .NET SDKs * Only build on Ubuntu * Do not build docs for pull requests * Add Cédric Luthi, and Frank Ray to authors * Drop netstandard2.0 for ImageSharp plugin
This commit is contained in:

committed by
Patrik Svensson

parent
703d653ec5
commit
b21e07ea94
@ -12,7 +12,7 @@ public class NoCurrentLiveRenderablesTests
|
||||
const string Source = @"
|
||||
using Spectre.Console;
|
||||
|
||||
class TestClass
|
||||
class TestClass
|
||||
{
|
||||
void Go()
|
||||
{
|
||||
@ -24,8 +24,7 @@ class TestClass
|
||||
}";
|
||||
|
||||
await SpectreAnalyzerVerifier<NoConcurrentLiveRenderablesAnalyzer>
|
||||
.VerifyAnalyzerAsync(Source, _expectedDiagnostics.WithLocation(10, 13))
|
||||
.ConfigureAwait(false);
|
||||
.VerifyAnalyzerAsync(Source, _expectedDiagnostics.WithLocation(10, 13));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@ -48,8 +47,7 @@ class Child
|
||||
}";
|
||||
|
||||
await SpectreAnalyzerVerifier<NoConcurrentLiveRenderablesAnalyzer>
|
||||
.VerifyAnalyzerAsync(Source, _expectedDiagnostics.WithLocation(12, 13))
|
||||
.ConfigureAwait(false);
|
||||
.VerifyAnalyzerAsync(Source, _expectedDiagnostics.WithLocation(12, 13));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@ -69,7 +67,6 @@ class Program
|
||||
}";
|
||||
|
||||
await SpectreAnalyzerVerifier<NoConcurrentLiveRenderablesAnalyzer>
|
||||
.VerifyAnalyzerAsync(Source)
|
||||
.ConfigureAwait(false);
|
||||
.VerifyAnalyzerAsync(Source);
|
||||
}
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ public class NoPromptsDuringLiveRenderablesTests
|
||||
const string Source = @"
|
||||
using Spectre.Console;
|
||||
|
||||
class TestClass
|
||||
class TestClass
|
||||
{
|
||||
void Go()
|
||||
{
|
||||
@ -21,8 +21,7 @@ class TestClass
|
||||
}";
|
||||
|
||||
await SpectreAnalyzerVerifier<NoPromptsDuringLiveRenderablesAnalyzer>
|
||||
.VerifyAnalyzerAsync(Source)
|
||||
.ConfigureAwait(false);
|
||||
.VerifyAnalyzerAsync(Source);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@ -31,7 +30,7 @@ class TestClass
|
||||
const string Source = @"
|
||||
using Spectre.Console;
|
||||
|
||||
class TestClass
|
||||
class TestClass
|
||||
{
|
||||
public IAnsiConsole _console = AnsiConsole.Console;
|
||||
|
||||
@ -45,8 +44,7 @@ class TestClass
|
||||
}";
|
||||
|
||||
await SpectreAnalyzerVerifier<NoPromptsDuringLiveRenderablesAnalyzer>
|
||||
.VerifyAnalyzerAsync(Source, _expectedDiagnostics.WithLocation(12, 26))
|
||||
.ConfigureAwait(false);
|
||||
.VerifyAnalyzerAsync(Source, _expectedDiagnostics.WithLocation(12, 26));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@ -55,7 +53,7 @@ class TestClass
|
||||
const string Source = @"
|
||||
using Spectre.Console;
|
||||
|
||||
class TestClass
|
||||
class TestClass
|
||||
{
|
||||
void Go()
|
||||
{
|
||||
@ -67,8 +65,7 @@ class TestClass
|
||||
}";
|
||||
|
||||
await SpectreAnalyzerVerifier<NoPromptsDuringLiveRenderablesAnalyzer>
|
||||
.VerifyAnalyzerAsync(Source, _expectedDiagnostics.WithLocation(10, 13))
|
||||
.ConfigureAwait(false);
|
||||
.VerifyAnalyzerAsync(Source, _expectedDiagnostics.WithLocation(10, 13));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@ -92,7 +89,6 @@ class Program
|
||||
}";
|
||||
|
||||
await SpectreAnalyzerVerifier<NoPromptsDuringLiveRenderablesAnalyzer>
|
||||
.VerifyAnalyzerAsync(Source)
|
||||
.ConfigureAwait(false);
|
||||
.VerifyAnalyzerAsync(Source);
|
||||
}
|
||||
}
|
||||
|
@ -24,8 +24,7 @@ internal sealed class Foo
|
||||
";
|
||||
|
||||
await SpectreAnalyzerVerifier<FavorInstanceAnsiConsoleOverStaticAnalyzer>
|
||||
.VerifyAnalyzerAsync(Source)
|
||||
.ConfigureAwait(false);
|
||||
.VerifyAnalyzerAsync(Source);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@ -34,19 +33,18 @@ internal sealed class Foo
|
||||
const string Source = @"
|
||||
using Spectre.Console;
|
||||
|
||||
class TestClass
|
||||
class TestClass
|
||||
{
|
||||
IAnsiConsole _ansiConsole = AnsiConsole.Console;
|
||||
IAnsiConsole _ansiConsole = AnsiConsole.Console;
|
||||
|
||||
void TestMethod()
|
||||
void TestMethod()
|
||||
{
|
||||
_ansiConsole.Write(""this is fine"");
|
||||
}
|
||||
}
|
||||
}";
|
||||
|
||||
await SpectreAnalyzerVerifier<FavorInstanceAnsiConsoleOverStaticAnalyzer>
|
||||
.VerifyAnalyzerAsync(Source)
|
||||
.ConfigureAwait(false);
|
||||
.VerifyAnalyzerAsync(Source);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@ -55,17 +53,16 @@ class TestClass
|
||||
const string Source = @"
|
||||
using Spectre.Console;
|
||||
|
||||
class TestClass
|
||||
class TestClass
|
||||
{
|
||||
void TestMethod()
|
||||
void TestMethod()
|
||||
{
|
||||
AnsiConsole.Write(""this is fine"");
|
||||
}
|
||||
}
|
||||
}";
|
||||
|
||||
await SpectreAnalyzerVerifier<FavorInstanceAnsiConsoleOverStaticAnalyzer>
|
||||
.VerifyAnalyzerAsync(Source)
|
||||
.ConfigureAwait(false);
|
||||
.VerifyAnalyzerAsync(Source);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@ -74,19 +71,18 @@ class TestClass
|
||||
const string Source = @"
|
||||
using Spectre.Console;
|
||||
|
||||
class TestClass
|
||||
class TestClass
|
||||
{
|
||||
IAnsiConsole _ansiConsole = AnsiConsole.Console;
|
||||
IAnsiConsole _ansiConsole = AnsiConsole.Console;
|
||||
|
||||
void TestMethod()
|
||||
void TestMethod()
|
||||
{
|
||||
_ansiConsole.Write(""this is fine"");
|
||||
AnsiConsole.Write(""Hello, World"");
|
||||
}
|
||||
}
|
||||
}";
|
||||
|
||||
await SpectreAnalyzerVerifier<FavorInstanceAnsiConsoleOverStaticAnalyzer>
|
||||
.VerifyAnalyzerAsync(Source, _expectedDiagnostics.WithLocation(11, 9))
|
||||
.ConfigureAwait(false);
|
||||
.VerifyAnalyzerAsync(Source, _expectedDiagnostics.WithLocation(11, 9));
|
||||
}
|
||||
}
|
||||
|
@ -13,15 +13,14 @@ public class UseSpectreInsteadOfSystemConsoleAnalyzerTests
|
||||
using System;
|
||||
|
||||
class TestClass {
|
||||
void TestMethod()
|
||||
void TestMethod()
|
||||
{
|
||||
var s = Console.ReadLine();
|
||||
}
|
||||
}
|
||||
}";
|
||||
|
||||
await SpectreAnalyzerVerifier<UseSpectreInsteadOfSystemConsoleAnalyzer>
|
||||
.VerifyAnalyzerAsync(Source)
|
||||
.ConfigureAwait(false);
|
||||
.VerifyAnalyzerAsync(Source);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@ -31,15 +30,14 @@ class TestClass {
|
||||
using System;
|
||||
|
||||
class TestClass {
|
||||
void TestMethod()
|
||||
void TestMethod()
|
||||
{
|
||||
Console.Write(""Hello, World"");
|
||||
}
|
||||
}
|
||||
}";
|
||||
|
||||
await SpectreAnalyzerVerifier<UseSpectreInsteadOfSystemConsoleAnalyzer>
|
||||
.VerifyAnalyzerAsync(Source, _expectedDiagnostics.WithLocation(7, 9))
|
||||
.ConfigureAwait(false);
|
||||
.VerifyAnalyzerAsync(Source, _expectedDiagnostics.WithLocation(7, 9));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@ -48,7 +46,7 @@ class TestClass {
|
||||
const string Source = @"
|
||||
using System;
|
||||
|
||||
class TestClass
|
||||
class TestClass
|
||||
{
|
||||
void TestMethod() {
|
||||
Console.WriteLine(""Hello, World"");
|
||||
@ -56,7 +54,6 @@ class TestClass
|
||||
}";
|
||||
|
||||
await SpectreAnalyzerVerifier<UseSpectreInsteadOfSystemConsoleAnalyzer>
|
||||
.VerifyAnalyzerAsync(Source, _expectedDiagnostics.WithLocation(7, 9))
|
||||
.ConfigureAwait(false);
|
||||
.VerifyAnalyzerAsync(Source, _expectedDiagnostics.WithLocation(7, 9));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user