未验证 提交 67cd7db8 编写于 作者: J Julien Couvreur 提交者: GitHub

Enable async-stream tests on Core (#30461)

上级 e96851ef
...@@ -381,7 +381,7 @@ async System.Collections.Generic.IAsyncEnumerable<int> M() ...@@ -381,7 +381,7 @@ async System.Collections.Generic.IAsyncEnumerable<int> M()
Assert.False(m.IsIterator); Assert.False(m.IsIterator);
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void AttributesSynthesized() public void AttributesSynthesized()
{ {
string source = @" string source = @"
...@@ -408,7 +408,7 @@ public static async System.Collections.Generic.IAsyncEnumerable<int> M() ...@@ -408,7 +408,7 @@ public static async System.Collections.Generic.IAsyncEnumerable<int> M()
}); });
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void AttributesSynthesized_Optional() public void AttributesSynthesized_Optional()
{ {
string source = @" string source = @"
...@@ -1017,7 +1017,7 @@ async System.Collections.Generic.IAsyncEnumerable<int> M2() ...@@ -1017,7 +1017,7 @@ async System.Collections.Generic.IAsyncEnumerable<int> M2()
); );
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
[WorkItem(31057, "https://github.com/dotnet/roslyn/issues/31057")] [WorkItem(31057, "https://github.com/dotnet/roslyn/issues/31057")]
public void AsyncIteratorReturningEnumerator() public void AsyncIteratorReturningEnumerator()
{ {
...@@ -1090,7 +1090,7 @@ void verifyMembersAndInterfaces(ModuleSymbol module) ...@@ -1090,7 +1090,7 @@ void verifyMembersAndInterfaces(ModuleSymbol module)
} }
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
[WorkItem(31057, "https://github.com/dotnet/roslyn/issues/31057")] [WorkItem(31057, "https://github.com/dotnet/roslyn/issues/31057")]
public void AsyncIteratorReturningEnumerator_CSharp73() public void AsyncIteratorReturningEnumerator_CSharp73()
{ {
...@@ -1122,7 +1122,7 @@ async System.Collections.Generic.IAsyncEnumerator<int> M() ...@@ -1122,7 +1122,7 @@ async System.Collections.Generic.IAsyncEnumerator<int> M()
comp.VerifyDiagnostics(); comp.VerifyDiagnostics();
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
[WorkItem(31057, "https://github.com/dotnet/roslyn/issues/31057")] [WorkItem(31057, "https://github.com/dotnet/roslyn/issues/31057")]
public void AsyncIteratorReturningEnumerator_WithReturnOnly() public void AsyncIteratorReturningEnumerator_WithReturnOnly()
{ {
...@@ -1145,7 +1145,7 @@ async System.Collections.Generic.IAsyncEnumerator<int> M() ...@@ -1145,7 +1145,7 @@ async System.Collections.Generic.IAsyncEnumerator<int> M()
); );
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
[WorkItem(31057, "https://github.com/dotnet/roslyn/issues/31057")] [WorkItem(31057, "https://github.com/dotnet/roslyn/issues/31057")]
public void ReturningIAsyncEnumerator_WithReturn() public void ReturningIAsyncEnumerator_WithReturn()
{ {
...@@ -1161,7 +1161,7 @@ System.Collections.Generic.IAsyncEnumerator<int> M() ...@@ -1161,7 +1161,7 @@ System.Collections.Generic.IAsyncEnumerator<int> M()
comp.VerifyDiagnostics(); comp.VerifyDiagnostics();
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
[WorkItem(31057, "https://github.com/dotnet/roslyn/issues/31057")] [WorkItem(31057, "https://github.com/dotnet/roslyn/issues/31057")]
public void AsyncIteratorReturningEnumerator_WithReturnAndAwait() public void AsyncIteratorReturningEnumerator_WithReturnAndAwait()
{ {
...@@ -1185,7 +1185,7 @@ static async System.Collections.Generic.IAsyncEnumerator<int> M(int value) ...@@ -1185,7 +1185,7 @@ static async System.Collections.Generic.IAsyncEnumerator<int> M(int value)
); );
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
[WorkItem(31057, "https://github.com/dotnet/roslyn/issues/31057")] [WorkItem(31057, "https://github.com/dotnet/roslyn/issues/31057")]
[WorkItem(31113, "https://github.com/dotnet/roslyn/issues/31113")] [WorkItem(31113, "https://github.com/dotnet/roslyn/issues/31113")]
[WorkItem(31608, "https://github.com/dotnet/roslyn/issues/31608")] [WorkItem(31608, "https://github.com/dotnet/roslyn/issues/31608")]
...@@ -1213,7 +1213,7 @@ static System.Collections.Generic.IAsyncEnumerator<int> M(int value) ...@@ -1213,7 +1213,7 @@ static System.Collections.Generic.IAsyncEnumerator<int> M(int value)
// This error message is rather poor. Tracked by https://github.com/dotnet/roslyn/issues/31113 // This error message is rather poor. Tracked by https://github.com/dotnet/roslyn/issues/31113
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
[WorkItem(31057, "https://github.com/dotnet/roslyn/issues/31057")] [WorkItem(31057, "https://github.com/dotnet/roslyn/issues/31057")]
public void AsyncIteratorReturningEnumerator_WithReturnAfterAwait() public void AsyncIteratorReturningEnumerator_WithReturnAfterAwait()
{ {
...@@ -1367,7 +1367,7 @@ public static async System.Collections.Generic.IAsyncEnumerable<int> M() ...@@ -1367,7 +1367,7 @@ public static async System.Collections.Generic.IAsyncEnumerable<int> M()
); );
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
[WorkItem(31608, "https://github.com/dotnet/roslyn/issues/31608")] [WorkItem(31608, "https://github.com/dotnet/roslyn/issues/31608")]
public void AsyncIterator_WithoutAwait() public void AsyncIterator_WithoutAwait()
{ {
...@@ -1388,7 +1388,7 @@ public static async System.Collections.Generic.IAsyncEnumerable<int> M() ...@@ -1388,7 +1388,7 @@ public static async System.Collections.Generic.IAsyncEnumerable<int> M()
CompileAndVerify(comp, expectedOutput: "1 END DISPOSAL DONE"); CompileAndVerify(comp, expectedOutput: "1 END DISPOSAL DONE");
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
[WorkItem(31608, "https://github.com/dotnet/roslyn/issues/31608")] [WorkItem(31608, "https://github.com/dotnet/roslyn/issues/31608")]
public void AsyncIterator_WithoutAwait_WithoutAsync() public void AsyncIterator_WithoutAwait_WithoutAsync()
{ {
...@@ -1408,7 +1408,7 @@ static System.Collections.Generic.IAsyncEnumerable<int> M() ...@@ -1408,7 +1408,7 @@ static System.Collections.Generic.IAsyncEnumerable<int> M()
); );
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
[WorkItem(31608, "https://github.com/dotnet/roslyn/issues/31608")] [WorkItem(31608, "https://github.com/dotnet/roslyn/issues/31608")]
public void AsyncIterator_WithoutAwait_WithoutAsync_LocalFunction() public void AsyncIterator_WithoutAwait_WithoutAsync_LocalFunction()
{ {
...@@ -1432,7 +1432,7 @@ static System.Collections.Generic.IAsyncEnumerator<int> local() ...@@ -1432,7 +1432,7 @@ static System.Collections.Generic.IAsyncEnumerator<int> local()
); );
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
[WorkItem(31608, "https://github.com/dotnet/roslyn/issues/31608")] [WorkItem(31608, "https://github.com/dotnet/roslyn/issues/31608")]
public void Iterator_WithAsync() public void Iterator_WithAsync()
{ {
...@@ -1477,7 +1477,7 @@ public static async System.Collections.Generic.IAsyncEnumerator<int> M() ...@@ -1477,7 +1477,7 @@ public static async System.Collections.Generic.IAsyncEnumerator<int> M()
); );
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
[WorkItem(31057, "https://github.com/dotnet/roslyn/issues/31057")] [WorkItem(31057, "https://github.com/dotnet/roslyn/issues/31057")]
public void AsyncIteratorReturningEnumerator_WithoutAwait() public void AsyncIteratorReturningEnumerator_WithoutAwait()
{ {
...@@ -1497,7 +1497,7 @@ static async System.Collections.Generic.IAsyncEnumerator<int> M(int value) ...@@ -1497,7 +1497,7 @@ static async System.Collections.Generic.IAsyncEnumerator<int> M(int value)
); );
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
[WorkItem(31057, "https://github.com/dotnet/roslyn/issues/31057")] [WorkItem(31057, "https://github.com/dotnet/roslyn/issues/31057")]
public void AsyncIteratorReturningEnumerator_WithoutYield() public void AsyncIteratorReturningEnumerator_WithoutYield()
{ {
...@@ -1517,7 +1517,7 @@ static async System.Collections.Generic.IAsyncEnumerator<int> M(int value) ...@@ -1517,7 +1517,7 @@ static async System.Collections.Generic.IAsyncEnumerator<int> M(int value)
); );
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void CallingMoveNextAsyncTwice() public void CallingMoveNextAsyncTwice()
{ {
string source = @" string source = @"
...@@ -1554,7 +1554,7 @@ await using (var enumerator = M().GetAsyncEnumerator()) ...@@ -1554,7 +1554,7 @@ await using (var enumerator = M().GetAsyncEnumerator())
CompileAndVerify(comp, expectedOutput: "0 1 2 3 4 5"); CompileAndVerify(comp, expectedOutput: "0 1 2 3 4 5");
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
[WorkItem(30275, "https://github.com/dotnet/roslyn/issues/30275")] [WorkItem(30275, "https://github.com/dotnet/roslyn/issues/30275")]
public void CallingGetEnumeratorTwice() public void CallingGetEnumeratorTwice()
{ {
...@@ -1630,7 +1630,7 @@ void verifyMembersAndInterfaces(ModuleSymbol module) ...@@ -1630,7 +1630,7 @@ void verifyMembersAndInterfaces(ModuleSymbol module)
} }
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
[WorkItem(30275, "https://github.com/dotnet/roslyn/issues/30275")] [WorkItem(30275, "https://github.com/dotnet/roslyn/issues/30275")]
public void CallingGetEnumeratorTwice2() public void CallingGetEnumeratorTwice2()
{ {
...@@ -1673,7 +1673,7 @@ await using (var enumerator2 = enumerable.GetAsyncEnumerator()) ...@@ -1673,7 +1673,7 @@ await using (var enumerator2 = enumerable.GetAsyncEnumerator())
CompileAndVerify(comp, expectedOutput: "1 2 Stream1:3 4 2 1 2 Stream2:3 4 2 Done"); CompileAndVerify(comp, expectedOutput: "1 2 Stream1:3 4 2 1 2 Stream2:3 4 2 Done");
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
[WorkItem(30275, "https://github.com/dotnet/roslyn/issues/30275")] [WorkItem(30275, "https://github.com/dotnet/roslyn/issues/30275")]
public void CallingGetEnumeratorTwice3() public void CallingGetEnumeratorTwice3()
{ {
...@@ -1722,7 +1722,7 @@ static async System.Threading.Tasks.Task Main() ...@@ -1722,7 +1722,7 @@ static async System.Threading.Tasks.Task Main()
CompileAndVerify(comp, expectedOutput: "Stream1:0 Stream2:0 1 2 Stream1:3 4 2 1 2 Stream2:3 4 2 Done"); CompileAndVerify(comp, expectedOutput: "Stream1:0 Stream2:0 1 2 Stream1:3 4 2 1 2 Stream2:3 4 2 Done");
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
[WorkItem(30275, "https://github.com/dotnet/roslyn/issues/30275")] [WorkItem(30275, "https://github.com/dotnet/roslyn/issues/30275")]
public void CallingGetEnumeratorTwice4() public void CallingGetEnumeratorTwice4()
{ {
...@@ -1767,7 +1767,7 @@ await foreach (var item2 in enumerable) ...@@ -1767,7 +1767,7 @@ await foreach (var item2 in enumerable)
CompileAndVerify(comp, expectedOutput: "Stream1:0 1 2 Stream1:3 4 42 Await Stream2:0 1 2 Stream2:3 4 42 Done"); CompileAndVerify(comp, expectedOutput: "Stream1:0 1 2 Stream1:3 4 42 Await Stream2:0 1 2 Stream2:3 4 42 Done");
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void CallingGetEnumeratorTwice_AfterDisposing() public void CallingGetEnumeratorTwice_AfterDisposing()
{ {
string source = @" string source = @"
...@@ -2337,7 +2337,7 @@ .maxstack 3 ...@@ -2337,7 +2337,7 @@ .maxstack 3
} }
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void AsyncIteratorWithGenericReturn() public void AsyncIteratorWithGenericReturn()
{ {
string source = @" string source = @"
...@@ -2367,7 +2367,7 @@ await foreach (var i in M(3)) ...@@ -2367,7 +2367,7 @@ await foreach (var i in M(3))
CompileAndVerify(comp, expectedOutput: "0 1 2 3 4 5"); CompileAndVerify(comp, expectedOutput: "0 1 2 3 4 5");
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void AsyncIteratorWithGenericReturnFromContainingType() public void AsyncIteratorWithGenericReturnFromContainingType()
{ {
string source = @" string source = @"
...@@ -2400,7 +2400,7 @@ await foreach (var i in C<int>.M(3)) ...@@ -2400,7 +2400,7 @@ await foreach (var i in C<int>.M(3))
CompileAndVerify(comp, expectedOutput: "0 1 2 3 4 5"); CompileAndVerify(comp, expectedOutput: "0 1 2 3 4 5");
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void AsyncIteratorWithParameter() public void AsyncIteratorWithParameter()
{ {
string source = @" string source = @"
...@@ -2432,7 +2432,7 @@ await foreach (var i in M(10)) ...@@ -2432,7 +2432,7 @@ await foreach (var i in M(10))
CompileAndVerify(comp, expectedOutput: "Start p:10 p:11 Value p:12 End"); CompileAndVerify(comp, expectedOutput: "Start p:10 p:11 Value p:12 End");
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void AsyncIteratorWithThis() public void AsyncIteratorWithThis()
{ {
string source = @" string source = @"
...@@ -2486,7 +2486,7 @@ public static async System.Collections.Generic.IAsyncEnumerable<int> M() ...@@ -2486,7 +2486,7 @@ public static async System.Collections.Generic.IAsyncEnumerable<int> M()
); );
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void AsyncIteratorWithAwaitCompletedAndOneYieldAndOneInvocation() public void AsyncIteratorWithAwaitCompletedAndOneYieldAndOneInvocation()
{ {
string source = @" string source = @"
...@@ -2516,7 +2516,7 @@ await foreach (var i in M()) ...@@ -2516,7 +2516,7 @@ await foreach (var i in M())
CompileAndVerify(comp, expectedOutput: "0 1 2 3 4 Done"); CompileAndVerify(comp, expectedOutput: "0 1 2 3 4 Done");
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void AsyncIteratorWithAwaitCompletedAndTwoYields() public void AsyncIteratorWithAwaitCompletedAndTwoYields()
{ {
string source = @" string source = @"
...@@ -2547,7 +2547,7 @@ await foreach (var i in M()) ...@@ -2547,7 +2547,7 @@ await foreach (var i in M())
CompileAndVerify(comp, expectedOutput: "0 1 2 3 4 5 Done"); CompileAndVerify(comp, expectedOutput: "0 1 2 3 4 5 Done");
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void AsyncIteratorWithYieldAndAwait() public void AsyncIteratorWithYieldAndAwait()
{ {
string source = @" string source = @"
...@@ -2599,7 +2599,7 @@ public static async System.Collections.Generic.IAsyncEnumerable<int> M() ...@@ -2599,7 +2599,7 @@ public static async System.Collections.Generic.IAsyncEnumerable<int> M()
CompileAndVerify(comp, expectedOutput: expectedOutput); CompileAndVerify(comp, expectedOutput: expectedOutput);
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void AsyncIteratorWithAwaitCompletedAndYieldBreakAndYieldReturn() public void AsyncIteratorWithAwaitCompletedAndYieldBreakAndYieldReturn()
{ {
string source = @" string source = @"
...@@ -2633,7 +2633,7 @@ await foreach (var i in M()) ...@@ -2633,7 +2633,7 @@ await foreach (var i in M())
CompileAndVerify(comp, expectedOutput: "0 1 2 3 Done"); CompileAndVerify(comp, expectedOutput: "0 1 2 3 Done");
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void AsyncIteratorWithCustomCode() public void AsyncIteratorWithCustomCode()
{ {
verify(new[] { AwaitSlow, Write, Yield, AwaitSlow }); verify(new[] { AwaitSlow, Write, Yield, AwaitSlow });
...@@ -2747,7 +2747,7 @@ async System.Collections.Generic.IAsyncEnumerable<int> local() ...@@ -2747,7 +2747,7 @@ async System.Collections.Generic.IAsyncEnumerable<int> local()
} }
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void AsyncIteratorWithAwaitAndYieldAndAwait() public void AsyncIteratorWithAwaitAndYieldAndAwait()
{ {
string source = @" string source = @"
...@@ -4508,7 +4508,7 @@ async System.Collections.Generic.IAsyncEnumerable<int> M() ...@@ -4508,7 +4508,7 @@ async System.Collections.Generic.IAsyncEnumerable<int> M()
); );
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void AsyncIteratorWithYieldReturnOnly() public void AsyncIteratorWithYieldReturnOnly()
{ {
string source = @" string source = @"
...@@ -4535,7 +4535,7 @@ await foreach (var i in M()) ...@@ -4535,7 +4535,7 @@ await foreach (var i in M())
CompileAndVerify(comp, expectedOutput: "1"); CompileAndVerify(comp, expectedOutput: "1");
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void AsyncIteratorWithYieldBreakOnly() public void AsyncIteratorWithYieldBreakOnly()
{ {
string source = @" string source = @"
...@@ -4721,7 +4721,7 @@ async Unknown local() ...@@ -4721,7 +4721,7 @@ async Unknown local()
); );
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void DisposeAsyncInBadState() public void DisposeAsyncInBadState()
{ {
string source = @" string source = @"
...@@ -4771,7 +4771,7 @@ public static async Task Main() ...@@ -4771,7 +4771,7 @@ public static async Task Main()
CompileAndVerify(comp, expectedOutput: "DisposeAsync threw. Already cancelled"); CompileAndVerify(comp, expectedOutput: "DisposeAsync threw. Already cancelled");
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void DisposeAsyncBeforeRunning() public void DisposeAsyncBeforeRunning()
{ {
string source = @" string source = @"
...@@ -4793,7 +4793,7 @@ public static async System.Threading.Tasks.Task Main() ...@@ -4793,7 +4793,7 @@ public static async System.Threading.Tasks.Task Main()
CompileAndVerify(comp, expectedOutput: "done"); CompileAndVerify(comp, expectedOutput: "done");
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void DisposeAsyncTwiceAfterRunning() public void DisposeAsyncTwiceAfterRunning()
{ {
string source = @" string source = @"
...@@ -4947,7 +4947,7 @@ static async Task Main() ...@@ -4947,7 +4947,7 @@ static async Task Main()
CompileAndVerify(comp, expectedOutput: "B1::F;D::F;B1::F;"); CompileAndVerify(comp, expectedOutput: "B1::F;D::F;B1::F;");
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void AsyncIteratorReturningEnumerator_UsingCancellationToken() public void AsyncIteratorReturningEnumerator_UsingCancellationToken()
{ {
string source = @" string source = @"
......
...@@ -77,7 +77,7 @@ public static async System.Threading.Tasks.Task Main() ...@@ -77,7 +77,7 @@ public static async System.Threading.Tasks.Task Main()
); );
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void TestWithIAsyncEnumerator() public void TestWithIAsyncEnumerator()
{ {
string source = @" string source = @"
...@@ -99,7 +99,7 @@ async Task M(IAsyncEnumerator<int> enumerator) ...@@ -99,7 +99,7 @@ async Task M(IAsyncEnumerator<int> enumerator)
); );
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void TestWithUIntToIntConversion() public void TestWithUIntToIntConversion()
{ {
string source = @" string source = @"
...@@ -767,7 +767,7 @@ class Element ...@@ -767,7 +767,7 @@ class Element
); );
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void TestWithExplicitlyConvertibleElementType() public void TestWithExplicitlyConvertibleElementType()
{ {
string source = @" string source = @"
...@@ -825,7 +825,7 @@ class Element ...@@ -825,7 +825,7 @@ class Element
expectedOutput: "NextAsync(0) Current(1) Convert(1) Got(1) NextAsync(1) Current(2) Convert(2) Got(2) NextAsync(2) Current(3) Convert(3) Got(3) NextAsync(3) Dispose(4)"); expectedOutput: "NextAsync(0) Current(1) Convert(1) Got(1) NextAsync(1) Current(2) Convert(2) Got(2) NextAsync(2) Current(3) Convert(3) Got(3) NextAsync(3) Dispose(4)");
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void TestWithCaptureOfIterationVariable() public void TestWithCaptureOfIterationVariable()
{ {
string source = @" string source = @"
...@@ -867,7 +867,7 @@ public async ValueTask DisposeAsync() ...@@ -867,7 +867,7 @@ public async ValueTask DisposeAsync()
CompileAndVerify(comp, expectedOutput: "Got(1) Got(2) Captured(1)"); CompileAndVerify(comp, expectedOutput: "Got(1) Got(2) Captured(1)");
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void TestWithGenericIterationVariable() public void TestWithGenericIterationVariable()
{ {
string source = @" string source = @"
...@@ -924,7 +924,7 @@ public async ValueTask DisposeAsync() ...@@ -924,7 +924,7 @@ public async ValueTask DisposeAsync()
CompileAndVerify(comp, expectedOutput: "NextAsync(1) Current(1) Got(1) NextAsync(2) Current(2) Got(2) NextAsync(3) Current(3) Got(3) NextAsync(4) Dispose(4)"); CompileAndVerify(comp, expectedOutput: "NextAsync(1) Current(1) Got(1) NextAsync(2) Current(2) Got(2) NextAsync(3) Current(3) Got(3) NextAsync(4) Dispose(4)");
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void TestWithThrowingGetAsyncEnumerator() public void TestWithThrowingGetAsyncEnumerator()
{ {
string source = @" string source = @"
...@@ -964,7 +964,7 @@ public ValueTask DisposeAsync() ...@@ -964,7 +964,7 @@ public ValueTask DisposeAsync()
CompileAndVerify(comp, expectedOutput: "exception"); CompileAndVerify(comp, expectedOutput: "exception");
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void TestWithThrowingMoveNextAsync() public void TestWithThrowingMoveNextAsync()
{ {
string source = @" string source = @"
...@@ -1007,7 +1007,7 @@ public async ValueTask DisposeAsync() ...@@ -1007,7 +1007,7 @@ public async ValueTask DisposeAsync()
CompileAndVerify(comp, expectedOutput: "dispose exception"); CompileAndVerify(comp, expectedOutput: "dispose exception");
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void TestWithThrowingCurrent() public void TestWithThrowingCurrent()
{ {
string source = @" string source = @"
...@@ -1054,7 +1054,7 @@ public async ValueTask DisposeAsync() ...@@ -1054,7 +1054,7 @@ public async ValueTask DisposeAsync()
CompileAndVerify(comp, expectedOutput: "wait dispose exception"); CompileAndVerify(comp, expectedOutput: "wait dispose exception");
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void TestWithThrowingDisposeAsync() public void TestWithThrowingDisposeAsync()
{ {
string source = @" string source = @"
...@@ -1855,7 +1855,7 @@ public sealed class Enumerator ...@@ -1855,7 +1855,7 @@ public sealed class Enumerator
Assert.Equal(default, model.GetForEachStatementInfo(foreachSyntax)); Assert.Equal(default, model.GetForEachStatementInfo(foreachSyntax));
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void TestWithPattern_RefStruct() public void TestWithPattern_RefStruct()
{ {
string source = @" string source = @"
...@@ -1902,7 +1902,7 @@ public S(int i) ...@@ -1902,7 +1902,7 @@ public S(int i)
CompileAndVerify(comp, expectedOutput: "1 2 Done"); CompileAndVerify(comp, expectedOutput: "1 2 Done");
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void TestWithPattern_RefReturningCurrent() public void TestWithPattern_RefReturningCurrent()
{ {
string source = @" string source = @"
...@@ -1984,7 +1984,7 @@ public System.Threading.Tasks.Task<bool> MoveNextAsync() ...@@ -1984,7 +1984,7 @@ public System.Threading.Tasks.Task<bool> MoveNextAsync()
); );
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void TestWithPattern_WithStruct_MoveNextAsyncReturnsTask() public void TestWithPattern_WithStruct_MoveNextAsyncReturnsTask()
{ {
string source = @" string source = @"
...@@ -2037,7 +2037,7 @@ public async ValueTask DisposeAsync() ...@@ -2037,7 +2037,7 @@ public async ValueTask DisposeAsync()
expectedOutput: "NextAsync(0) Current(0) Got(1) NextAsync(1) Current(1) Got(2) NextAsync(2) Current(2) Got(3) NextAsync(3) Current(3) Got(4) NextAsync(4) DisposeAsync Done"); expectedOutput: "NextAsync(0) Current(0) Got(1) NextAsync(1) Current(1) Got(2) NextAsync(2) Current(2) Got(3) NextAsync(3) Current(3) Got(4) NextAsync(4) DisposeAsync Done");
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void TestWithPattern_MoveNextAsyncReturnsValueTask() public void TestWithPattern_MoveNextAsyncReturnsValueTask()
{ {
string source = @" string source = @"
...@@ -2100,7 +2100,7 @@ public async ValueTask DisposeAsync() ...@@ -2100,7 +2100,7 @@ public async ValueTask DisposeAsync()
Assert.True(internalInfo.NeedsDisposal); Assert.True(internalInfo.NeedsDisposal);
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
[WorkItem(31609, "https://github.com/dotnet/roslyn/issues/31609")] [WorkItem(31609, "https://github.com/dotnet/roslyn/issues/31609")]
public void TestWithPattern_MoveNextAsyncReturnsAwaitable() public void TestWithPattern_MoveNextAsyncReturnsAwaitable()
{ {
...@@ -2160,7 +2160,7 @@ public class Awaiter : System.Runtime.CompilerServices.INotifyCompletion ...@@ -2160,7 +2160,7 @@ public class Awaiter : System.Runtime.CompilerServices.INotifyCompletion
Assert.Equal("System.Int32", info.ElementType.ToTestDisplayString()); Assert.Equal("System.Int32", info.ElementType.ToTestDisplayString());
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
[WorkItem(31609, "https://github.com/dotnet/roslyn/issues/31609")] [WorkItem(31609, "https://github.com/dotnet/roslyn/issues/31609")]
public void TestWithPattern_MoveNextAsyncReturnsAwaitable_WithoutGetAwaiter() public void TestWithPattern_MoveNextAsyncReturnsAwaitable_WithoutGetAwaiter()
{ {
...@@ -2194,7 +2194,7 @@ public class Awaitable ...@@ -2194,7 +2194,7 @@ public class Awaitable
VerifyEmptyForEachStatementInfo(comp); VerifyEmptyForEachStatementInfo(comp);
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
[WorkItem(31609, "https://github.com/dotnet/roslyn/issues/31609")] [WorkItem(31609, "https://github.com/dotnet/roslyn/issues/31609")]
public void TestWithPattern_MoveNextAsyncReturnsAwaitable_WithoutIsCompleted() public void TestWithPattern_MoveNextAsyncReturnsAwaitable_WithoutIsCompleted()
{ {
...@@ -2245,7 +2245,7 @@ private static void VerifyEmptyForEachStatementInfo(CSharpCompilation comp) ...@@ -2245,7 +2245,7 @@ private static void VerifyEmptyForEachStatementInfo(CSharpCompilation comp)
Assert.Null(info.ElementType); Assert.Null(info.ElementType);
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
[WorkItem(31609, "https://github.com/dotnet/roslyn/issues/31609")] [WorkItem(31609, "https://github.com/dotnet/roslyn/issues/31609")]
public void TestWithPattern_MoveNextAsyncReturnsAwaitable_WithoutGetResult() public void TestWithPattern_MoveNextAsyncReturnsAwaitable_WithoutGetResult()
{ {
...@@ -2285,7 +2285,7 @@ public class Awaiter : System.Runtime.CompilerServices.INotifyCompletion ...@@ -2285,7 +2285,7 @@ public class Awaiter : System.Runtime.CompilerServices.INotifyCompletion
VerifyEmptyForEachStatementInfo(comp); VerifyEmptyForEachStatementInfo(comp);
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
[WorkItem(31609, "https://github.com/dotnet/roslyn/issues/31609")] [WorkItem(31609, "https://github.com/dotnet/roslyn/issues/31609")]
public void TestWithPattern_MoveNextAsyncReturnsAwaitable_WithoutOnCompleted() public void TestWithPattern_MoveNextAsyncReturnsAwaitable_WithoutOnCompleted()
{ {
...@@ -2326,7 +2326,7 @@ public class Awaiter ...@@ -2326,7 +2326,7 @@ public class Awaiter
VerifyEmptyForEachStatementInfo(comp); VerifyEmptyForEachStatementInfo(comp);
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void TestWithPattern_MoveNextAsyncReturnsBadType() public void TestWithPattern_MoveNextAsyncReturnsBadType()
{ {
string source = @" string source = @"
...@@ -2362,7 +2362,7 @@ public class AsyncEnumerator ...@@ -2362,7 +2362,7 @@ public class AsyncEnumerator
Assert.Null(info.ElementType); Assert.Null(info.ElementType);
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void TestWithPattern_WithUnsealed() public void TestWithPattern_WithUnsealed()
{ {
string source = @" string source = @"
...@@ -2609,7 +2609,7 @@ .maxstack 3 ...@@ -2609,7 +2609,7 @@ .maxstack 3
}", sequencePoints: "C+<Main>d__0.MoveNext", source: source + s_IAsyncEnumerable); }", sequencePoints: "C+<Main>d__0.MoveNext", source: source + s_IAsyncEnumerable);
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void TestWithPattern_WithIAsyncDisposable() public void TestWithPattern_WithIAsyncDisposable()
{ {
string source = @" string source = @"
...@@ -2774,7 +2774,7 @@ IAsyncEnumerator<int> IAsyncEnumerable<int>.GetAsyncEnumerator(System.Threading. ...@@ -2774,7 +2774,7 @@ IAsyncEnumerator<int> IAsyncEnumerable<int>.GetAsyncEnumerator(System.Threading.
); );
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void TestWithInterface() public void TestWithInterface()
{ {
string source = @" string source = @"
...@@ -2847,7 +2847,7 @@ async ValueTask IAsyncDisposable.DisposeAsync() ...@@ -2847,7 +2847,7 @@ async ValueTask IAsyncDisposable.DisposeAsync()
Assert.True(internalInfo.NeedsDisposal); Assert.True(internalInfo.NeedsDisposal);
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void TestWithInterface_OnStruct_ImplicitInterfaceImplementation() public void TestWithInterface_OnStruct_ImplicitInterfaceImplementation()
{ {
string source = @" string source = @"
...@@ -3114,7 +3114,7 @@ .maxstack 3 ...@@ -3114,7 +3114,7 @@ .maxstack 3
}"); }");
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void TestWithInterface_WithEarlyCompletion1() public void TestWithInterface_WithEarlyCompletion1()
{ {
string source = @" string source = @"
...@@ -3166,7 +3166,7 @@ public ValueTask DisposeAsync() ...@@ -3166,7 +3166,7 @@ public ValueTask DisposeAsync()
CompileAndVerify(comp, expectedOutput: "NextAsync(2) Current(3) Got(3) NextAsync(3) Dispose(4) Done"); CompileAndVerify(comp, expectedOutput: "NextAsync(2) Current(3) Got(3) NextAsync(3) Dispose(4) Done");
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void TestWithInterface_WithBreakAndContinue() public void TestWithInterface_WithBreakAndContinue()
{ {
string source = @" string source = @"
...@@ -3221,7 +3221,7 @@ public async ValueTask DisposeAsync() ...@@ -3221,7 +3221,7 @@ public async ValueTask DisposeAsync()
expectedOutput: "NextAsync(0) Current(1) Got(1) NextAsync(1) Current(2) Continue(2) NextAsync(2) Current(3) Continue(3) NextAsync(3) Current(4) Break Dispose(4) Done"); expectedOutput: "NextAsync(0) Current(1) Got(1) NextAsync(1) Current(2) Continue(2) NextAsync(2) Current(3) Continue(3) NextAsync(3) Current(4) Break Dispose(4) Done");
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void TestWithInterface_WithGoto() public void TestWithInterface_WithGoto()
{ {
string source = @" string source = @"
...@@ -3277,7 +3277,7 @@ public async ValueTask DisposeAsync() ...@@ -3277,7 +3277,7 @@ public async ValueTask DisposeAsync()
expectedOutput: "NextAsync(0) Current(1) Got(1) NextAsync(1) Current(2) Continue(2) NextAsync(2) Current(3) Continue(3) NextAsync(3) Current(4) Goto Dispose(4) Done"); expectedOutput: "NextAsync(0) Current(1) Got(1) NextAsync(1) Current(2) Continue(2) NextAsync(2) Current(3) Continue(3) NextAsync(3) Current(4) Goto Dispose(4) Done");
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void TestWithInterface_WithStruct() public void TestWithInterface_WithStruct()
{ {
string source = @" string source = @"
...@@ -3381,7 +3381,7 @@ IAsyncEnumerator<int> IAsyncEnumerable<int>.GetAsyncEnumerator(System.Threading. ...@@ -3381,7 +3381,7 @@ IAsyncEnumerator<int> IAsyncEnumerable<int>.GetAsyncEnumerator(System.Threading.
); );
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void TestWithNullCollection() public void TestWithNullCollection()
{ {
string source = @" string source = @"
...@@ -3421,7 +3421,7 @@ internal struct AsyncEnumerator : IAsyncEnumerator<int> ...@@ -3421,7 +3421,7 @@ internal struct AsyncEnumerator : IAsyncEnumerator<int>
CompileAndVerify(comp, expectedOutput: "Success"); CompileAndVerify(comp, expectedOutput: "Success");
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void TestInCatch() public void TestInCatch()
{ {
string source = @" string source = @"
...@@ -3511,7 +3511,7 @@ IAsyncEnumerator<int> IAsyncEnumerable<int>.GetAsyncEnumerator(System.Threading. ...@@ -3511,7 +3511,7 @@ IAsyncEnumerator<int> IAsyncEnumerable<int>.GetAsyncEnumerator(System.Threading.
comp.VerifyDiagnostics(); comp.VerifyDiagnostics();
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void TestWithConversionToElement() public void TestWithConversionToElement()
{ {
string source = @" string source = @"
...@@ -3592,7 +3592,7 @@ class Element ...@@ -3592,7 +3592,7 @@ class Element
Assert.True(internalInfo.NeedsDisposal); Assert.True(internalInfo.NeedsDisposal);
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void TestWithNullableCollection() public void TestWithNullableCollection()
{ {
string source = @" string source = @"
...@@ -3665,7 +3665,7 @@ public async ValueTask DisposeAsync() ...@@ -3665,7 +3665,7 @@ public async ValueTask DisposeAsync()
Assert.True(internalInfo.NeedsDisposal); Assert.True(internalInfo.NeedsDisposal);
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void TestWithNullableCollection2() public void TestWithNullableCollection2()
{ {
string source = @" string source = @"
...@@ -3699,7 +3699,7 @@ IAsyncEnumerator<int> IAsyncEnumerable<int>.GetAsyncEnumerator(System.Threading. ...@@ -3699,7 +3699,7 @@ IAsyncEnumerator<int> IAsyncEnumerable<int>.GetAsyncEnumerator(System.Threading.
CompileAndVerify(comp, expectedOutput: "Success"); CompileAndVerify(comp, expectedOutput: "Success");
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void TestWithInterfaceAndDeconstruction() public void TestWithInterfaceAndDeconstruction()
{ {
string source = @" string source = @"
...@@ -3803,7 +3803,7 @@ public static class Extensions ...@@ -3803,7 +3803,7 @@ public static class Extensions
); );
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void TestWithPatternAndDeconstructionOfTuple() public void TestWithPatternAndDeconstructionOfTuple()
{ {
string source = @" string source = @"
...@@ -3869,7 +3869,7 @@ public async ValueTask DisposeAsync() ...@@ -3869,7 +3869,7 @@ public async ValueTask DisposeAsync()
Assert.Equal(ConversionKind.Identity, info.CurrentConversion.Kind); Assert.Equal(ConversionKind.Identity, info.CurrentConversion.Kind);
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void TestWithInterfaceAndDeconstruction_ManualIteration() public void TestWithInterfaceAndDeconstruction_ManualIteration()
{ {
string source = @" string source = @"
...@@ -4027,7 +4027,7 @@ public IAsyncEnumerator<int> GetAsyncEnumerator(System.Threading.CancellationTok ...@@ -4027,7 +4027,7 @@ public IAsyncEnumerator<int> GetAsyncEnumerator(System.Threading.CancellationTok
); );
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void TestWithGenericCollection() public void TestWithGenericCollection()
{ {
string source = @" string source = @"
...@@ -4382,7 +4382,7 @@ await foreach (var i in c) ...@@ -4382,7 +4382,7 @@ await foreach (var i in c)
Assert.Null(info.DisposeMethod); Assert.Null(info.DisposeMethod);
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void GetAsyncEnumerator_CancellationTokenMustBeOptional() public void GetAsyncEnumerator_CancellationTokenMustBeOptional()
{ {
string source = @" string source = @"
...@@ -4409,7 +4409,7 @@ public IAsyncEnumerator<int> GetAsyncEnumerator(System.Threading.CancellationTok ...@@ -4409,7 +4409,7 @@ public IAsyncEnumerator<int> GetAsyncEnumerator(System.Threading.CancellationTok
); );
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void GetAsyncEnumerator_WithOptionalParameter() public void GetAsyncEnumerator_WithOptionalParameter()
{ {
string source = @" string source = @"
...@@ -4432,7 +4432,7 @@ public IAsyncEnumerator<int> GetAsyncEnumerator(int opt = 0) ...@@ -4432,7 +4432,7 @@ public IAsyncEnumerator<int> GetAsyncEnumerator(int opt = 0)
comp.VerifyDiagnostics(); comp.VerifyDiagnostics();
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void GetAsyncEnumerator_WithParams() public void GetAsyncEnumerator_WithParams()
{ {
string source = @" string source = @"
...@@ -4468,7 +4468,7 @@ public int Current ...@@ -4468,7 +4468,7 @@ public int Current
CompileAndVerify(comp, expectedOutput: "MoveNextAsync"); CompileAndVerify(comp, expectedOutput: "MoveNextAsync");
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
[WorkItem(32316, "https://github.com/dotnet/roslyn/issues/32316")] [WorkItem(32316, "https://github.com/dotnet/roslyn/issues/32316")]
public void PatternBasedDisposal() public void PatternBasedDisposal()
{ {
...@@ -4511,7 +4511,7 @@ public async Task DisposeAsync() ...@@ -4511,7 +4511,7 @@ public async Task DisposeAsync()
CompileAndVerify(comp, expectedOutput: "MoveNextAsync DisposeAsync Done"); CompileAndVerify(comp, expectedOutput: "MoveNextAsync DisposeAsync Done");
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
[WorkItem(32316, "https://github.com/dotnet/roslyn/issues/32316")] [WorkItem(32316, "https://github.com/dotnet/roslyn/issues/32316")]
public void PatternBasedDisposal_TwoOverloads() public void PatternBasedDisposal_TwoOverloads()
{ {
...@@ -4556,7 +4556,7 @@ public Task DisposeAsync(params string[] s) ...@@ -4556,7 +4556,7 @@ public Task DisposeAsync(params string[] s)
CompileAndVerify(comp, expectedOutput: "MoveNextAsync DisposeAsync Done"); CompileAndVerify(comp, expectedOutput: "MoveNextAsync DisposeAsync Done");
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
[WorkItem(32316, "https://github.com/dotnet/roslyn/issues/32316")] [WorkItem(32316, "https://github.com/dotnet/roslyn/issues/32316")]
public void PatternBasedDisposal_NoExtensions() public void PatternBasedDisposal_NoExtensions()
{ {
...@@ -4599,7 +4599,7 @@ public static class Extension ...@@ -4599,7 +4599,7 @@ public static class Extension
CompileAndVerify(comp, expectedOutput: "MoveNextAsync Done"); CompileAndVerify(comp, expectedOutput: "MoveNextAsync Done");
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
[WorkItem(32316, "https://github.com/dotnet/roslyn/issues/32316")] [WorkItem(32316, "https://github.com/dotnet/roslyn/issues/32316")]
public void PatternBasedDisposal_NoExtensions_TwoExtensions() public void PatternBasedDisposal_NoExtensions_TwoExtensions()
{ {
...@@ -4647,7 +4647,7 @@ public static class Extension2 ...@@ -4647,7 +4647,7 @@ public static class Extension2
CompileAndVerify(comp, expectedOutput: "MoveNextAsync Done"); CompileAndVerify(comp, expectedOutput: "MoveNextAsync Done");
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
[WorkItem(32316, "https://github.com/dotnet/roslyn/issues/32316")] [WorkItem(32316, "https://github.com/dotnet/roslyn/issues/32316")]
public void PatternBasedDisposal_InterfacePreferredToInstanceMethod() public void PatternBasedDisposal_InterfacePreferredToInstanceMethod()
{ {
...@@ -4691,7 +4691,7 @@ async ValueTask System.IAsyncDisposable.DisposeAsync() ...@@ -4691,7 +4691,7 @@ async ValueTask System.IAsyncDisposable.DisposeAsync()
CompileAndVerify(comp, expectedOutput: "MoveNextAsync DisposeAsync Done"); CompileAndVerify(comp, expectedOutput: "MoveNextAsync DisposeAsync Done");
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
[WorkItem(32316, "https://github.com/dotnet/roslyn/issues/32316")] [WorkItem(32316, "https://github.com/dotnet/roslyn/issues/32316")]
public void PatternBasedDisposal_ReturnsVoid() public void PatternBasedDisposal_ReturnsVoid()
{ {
...@@ -4727,7 +4727,7 @@ public void DisposeAsync() ...@@ -4727,7 +4727,7 @@ public void DisposeAsync()
); );
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
[WorkItem(32316, "https://github.com/dotnet/roslyn/issues/32316")] [WorkItem(32316, "https://github.com/dotnet/roslyn/issues/32316")]
public void PatternBasedDisposal_ReturnsInt() public void PatternBasedDisposal_ReturnsInt()
{ {
...@@ -4770,7 +4770,7 @@ public int DisposeAsync() ...@@ -4770,7 +4770,7 @@ public int DisposeAsync()
); );
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
[WorkItem(32316, "https://github.com/dotnet/roslyn/issues/32316")] [WorkItem(32316, "https://github.com/dotnet/roslyn/issues/32316")]
public void PatternBasedDisposal_ReturnsAwaitable() public void PatternBasedDisposal_ReturnsAwaitable()
{ {
...@@ -4825,7 +4825,7 @@ public class Awaiter : System.Runtime.CompilerServices.INotifyCompletion ...@@ -4825,7 +4825,7 @@ public class Awaiter : System.Runtime.CompilerServices.INotifyCompletion
CompileAndVerify(comp, expectedOutput: "MoveNextAsync DisposeAsync Done"); CompileAndVerify(comp, expectedOutput: "MoveNextAsync DisposeAsync Done");
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
[WorkItem(32316, "https://github.com/dotnet/roslyn/issues/32316")] [WorkItem(32316, "https://github.com/dotnet/roslyn/issues/32316")]
public void PatternBasedDisposal_ReturnsTask() public void PatternBasedDisposal_ReturnsTask()
{ {
...@@ -4869,7 +4869,7 @@ public async Task DisposeAsync() ...@@ -4869,7 +4869,7 @@ public async Task DisposeAsync()
CompileAndVerify(comp, expectedOutput: "MoveNextAsync DisposeAsync Done"); CompileAndVerify(comp, expectedOutput: "MoveNextAsync DisposeAsync Done");
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
[WorkItem(32316, "https://github.com/dotnet/roslyn/issues/32316")] [WorkItem(32316, "https://github.com/dotnet/roslyn/issues/32316")]
public void PatternBasedDisposal_ReturnsTaskOfInt() public void PatternBasedDisposal_ReturnsTaskOfInt()
{ {
......
...@@ -156,7 +156,7 @@ public static async Task Main() ...@@ -156,7 +156,7 @@ public static async Task Main()
); );
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void TestInAsyncAnonymousMethod() public void TestInAsyncAnonymousMethod()
{ {
string source = @" string source = @"
...@@ -298,7 +298,7 @@ public void Dispose() ...@@ -298,7 +298,7 @@ public void Dispose()
comp.VerifyDiagnostics(); comp.VerifyDiagnostics();
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void TestInCatchBlock() public void TestInCatchBlock()
{ {
string source = @" string source = @"
...@@ -413,7 +413,7 @@ async System.Threading.Tasks.Task innerLocal() ...@@ -413,7 +413,7 @@ async System.Threading.Tasks.Task innerLocal()
); );
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void TestInFinallyBlock() public void TestInFinallyBlock()
{ {
string source = @" string source = @"
...@@ -448,7 +448,7 @@ public async System.Threading.Tasks.ValueTask DisposeAsync() ...@@ -448,7 +448,7 @@ public async System.Threading.Tasks.ValueTask DisposeAsync()
CompileAndVerify(comp, expectedOutput: "using dispose_start dispose_end return"); CompileAndVerify(comp, expectedOutput: "using dispose_start dispose_end return");
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void TestThrowingDisposeAsync() public void TestThrowingDisposeAsync()
{ {
string source = @" string source = @"
...@@ -484,7 +484,7 @@ public async System.Threading.Tasks.ValueTask DisposeAsync() ...@@ -484,7 +484,7 @@ public async System.Threading.Tasks.ValueTask DisposeAsync()
CompileAndVerify(comp, expectedOutput: "using caught message"); CompileAndVerify(comp, expectedOutput: "using caught message");
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void TestRegularAwaitInFinallyBlock() public void TestRegularAwaitInFinallyBlock()
{ {
string source = @" string source = @"
...@@ -761,7 +761,7 @@ await using (var x = new C()) ...@@ -761,7 +761,7 @@ await using (var x = new C())
); );
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void TestWithDeclaration() public void TestWithDeclaration()
{ {
string source = @" string source = @"
...@@ -791,7 +791,7 @@ public void Dispose() ...@@ -791,7 +791,7 @@ public void Dispose()
CompileAndVerify(comp, expectedOutput: "body DisposeAsync"); CompileAndVerify(comp, expectedOutput: "body DisposeAsync");
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void TestIAsyncDisposableInRegularUsing() public void TestIAsyncDisposableInRegularUsing()
{ {
string source = @" string source = @"
...@@ -871,7 +871,7 @@ public void Dispose() ...@@ -871,7 +871,7 @@ public void Dispose()
CompileAndVerify(comp, expectedOutput: "body Dispose"); CompileAndVerify(comp, expectedOutput: "body Dispose");
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void TestIDisposableInAwaitUsing() public void TestIDisposableInAwaitUsing()
{ {
string source = @" string source = @"
...@@ -921,7 +921,7 @@ public void Dispose() ...@@ -921,7 +921,7 @@ public void Dispose()
); );
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void TestWithDynamicDeclaration_ExplicitInterfaceImplementation() public void TestWithDynamicDeclaration_ExplicitInterfaceImplementation()
{ {
string source = @" string source = @"
...@@ -948,7 +948,7 @@ System.Threading.Tasks.ValueTask System.IAsyncDisposable.DisposeAsync() ...@@ -948,7 +948,7 @@ System.Threading.Tasks.ValueTask System.IAsyncDisposable.DisposeAsync()
CompileAndVerify(comp, expectedOutput: "body DisposeAsync end"); CompileAndVerify(comp, expectedOutput: "body DisposeAsync end");
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void TestWithDynamicDeclaration() public void TestWithDynamicDeclaration()
{ {
string source = @" string source = @"
...@@ -975,7 +975,7 @@ public System.Threading.Tasks.ValueTask DisposeAsync() ...@@ -975,7 +975,7 @@ public System.Threading.Tasks.ValueTask DisposeAsync()
CompileAndVerify(comp, expectedOutput: "body DisposeAsync end"); CompileAndVerify(comp, expectedOutput: "body DisposeAsync end");
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void TestWithExpression() public void TestWithExpression()
{ {
string source = @" string source = @"
...@@ -1149,7 +1149,7 @@ .maxstack 3 ...@@ -1149,7 +1149,7 @@ .maxstack 3
"); ");
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void TestWithNullExpression() public void TestWithNullExpression()
{ {
string source = @" string source = @"
...@@ -1192,7 +1192,7 @@ await using (Main) ...@@ -1192,7 +1192,7 @@ await using (Main)
); );
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void TestWithDynamicExpression() public void TestWithDynamicExpression()
{ {
string source = @" string source = @"
...@@ -1219,7 +1219,7 @@ public System.Threading.Tasks.ValueTask DisposeAsync() ...@@ -1219,7 +1219,7 @@ public System.Threading.Tasks.ValueTask DisposeAsync()
CompileAndVerify(comp, expectedOutput: "body DisposeAsync"); CompileAndVerify(comp, expectedOutput: "body DisposeAsync");
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void TestWithStructExpression() public void TestWithStructExpression()
{ {
string source = @" string source = @"
...@@ -1388,7 +1388,7 @@ .maxstack 3 ...@@ -1388,7 +1388,7 @@ .maxstack 3
"); ");
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void TestWithNullableExpression() public void TestWithNullableExpression()
{ {
string source = @" string source = @"
...@@ -1415,7 +1415,7 @@ public System.Threading.Tasks.ValueTask DisposeAsync() ...@@ -1415,7 +1415,7 @@ public System.Threading.Tasks.ValueTask DisposeAsync()
CompileAndVerify(comp, expectedOutput: "body DisposeAsync"); CompileAndVerify(comp, expectedOutput: "body DisposeAsync");
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void TestWithNullNullableExpression() public void TestWithNullNullableExpression()
{ {
string source = @" string source = @"
...@@ -1478,7 +1478,7 @@ async void L1() ...@@ -1478,7 +1478,7 @@ async void L1()
); );
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void TestWithMultipleResources() public void TestWithMultipleResources()
{ {
string source = @" string source = @"
...@@ -1511,7 +1511,7 @@ public async System.Threading.Tasks.ValueTask DisposeAsync() ...@@ -1511,7 +1511,7 @@ public async System.Threading.Tasks.ValueTask DisposeAsync()
CompileAndVerify(comp, expectedOutput: "ctor1 ctor2 body dispose2_start dispose2_end dispose1_start dispose1_end"); CompileAndVerify(comp, expectedOutput: "ctor1 ctor2 body dispose2_start dispose2_end dispose1_start dispose1_end");
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void TestWithMultipleResourcesAndException() public void TestWithMultipleResourcesAndException()
{ {
string source = @" string source = @"
...@@ -1550,7 +1550,7 @@ public System.Threading.Tasks.ValueTask DisposeAsync() ...@@ -1550,7 +1550,7 @@ public System.Threading.Tasks.ValueTask DisposeAsync()
CompileAndVerify(comp, expectedOutput: "ctor1 ctor2 body dispose2 dispose1 caught"); CompileAndVerify(comp, expectedOutput: "ctor1 ctor2 body dispose2 dispose1 caught");
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void TestWithMultipleResourcesAndExceptionInSecondResource() public void TestWithMultipleResourcesAndExceptionInSecondResource()
{ {
string source = @" string source = @"
...@@ -1658,7 +1658,7 @@ public class D ...@@ -1658,7 +1658,7 @@ public class D
Assert.True(first.GetHashCode() == another.GetHashCode()); Assert.True(first.GetHashCode() == another.GetHashCode());
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
[WorkItem(32316, "https://github.com/dotnet/roslyn/issues/32316")] [WorkItem(32316, "https://github.com/dotnet/roslyn/issues/32316")]
public void TestPatternBasedDisposal_ExtensionMethod() public void TestPatternBasedDisposal_ExtensionMethod()
{ {
...@@ -1689,7 +1689,7 @@ public static System.Threading.Tasks.ValueTask DisposeAsync(this C c) ...@@ -1689,7 +1689,7 @@ public static System.Threading.Tasks.ValueTask DisposeAsync(this C c)
); );
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
[WorkItem(32316, "https://github.com/dotnet/roslyn/issues/32316")] [WorkItem(32316, "https://github.com/dotnet/roslyn/issues/32316")]
public void TestPatternBasedDisposal_TwoOverloads() public void TestPatternBasedDisposal_TwoOverloads()
{ {
...@@ -1717,7 +1717,7 @@ public System.Threading.Tasks.ValueTask DisposeAsync(params string[] s) ...@@ -1717,7 +1717,7 @@ public System.Threading.Tasks.ValueTask DisposeAsync(params string[] s)
CompileAndVerify(comp, expectedOutput: "dispose"); CompileAndVerify(comp, expectedOutput: "dispose");
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
[WorkItem(32316, "https://github.com/dotnet/roslyn/issues/32316")] [WorkItem(32316, "https://github.com/dotnet/roslyn/issues/32316")]
public void TestPatternBasedDisposal_Expression_ExtensionMethod() public void TestPatternBasedDisposal_Expression_ExtensionMethod()
{ {
...@@ -1748,7 +1748,7 @@ public static System.Threading.Tasks.ValueTask DisposeAsync(this C c) ...@@ -1748,7 +1748,7 @@ public static System.Threading.Tasks.ValueTask DisposeAsync(this C c)
); );
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
[WorkItem(32316, "https://github.com/dotnet/roslyn/issues/32316")] [WorkItem(32316, "https://github.com/dotnet/roslyn/issues/32316")]
public void TestPatternBasedDisposal_Expression_InstanceMethod() public void TestPatternBasedDisposal_Expression_InstanceMethod()
{ {
...@@ -1778,7 +1778,7 @@ public async System.Threading.Tasks.ValueTask DisposeAsync() ...@@ -1778,7 +1778,7 @@ public async System.Threading.Tasks.ValueTask DisposeAsync()
CompileAndVerify(comp, expectedOutput: "using dispose_start dispose_end return"); CompileAndVerify(comp, expectedOutput: "using dispose_start dispose_end return");
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
[WorkItem(32316, "https://github.com/dotnet/roslyn/issues/32316")] [WorkItem(32316, "https://github.com/dotnet/roslyn/issues/32316")]
public void TestPatternBasedDisposal_InstanceMethod() public void TestPatternBasedDisposal_InstanceMethod()
{ {
...@@ -1808,7 +1808,7 @@ public async System.Threading.Tasks.ValueTask DisposeAsync() ...@@ -1808,7 +1808,7 @@ public async System.Threading.Tasks.ValueTask DisposeAsync()
CompileAndVerify(comp, expectedOutput: "using dispose_start dispose_end return"); CompileAndVerify(comp, expectedOutput: "using dispose_start dispose_end return");
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
[WorkItem(32316, "https://github.com/dotnet/roslyn/issues/32316")] [WorkItem(32316, "https://github.com/dotnet/roslyn/issues/32316")]
public void TestPatternBasedDisposal_InterfacePreferredOverInstanceMethod() public void TestPatternBasedDisposal_InterfacePreferredOverInstanceMethod()
{ {
...@@ -1840,7 +1840,7 @@ public System.Threading.Tasks.ValueTask DisposeAsync() ...@@ -1840,7 +1840,7 @@ public System.Threading.Tasks.ValueTask DisposeAsync()
CompileAndVerify(comp, expectedOutput: "using dispose_start dispose_end return"); CompileAndVerify(comp, expectedOutput: "using dispose_start dispose_end return");
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
[WorkItem(32316, "https://github.com/dotnet/roslyn/issues/32316")] [WorkItem(32316, "https://github.com/dotnet/roslyn/issues/32316")]
public void TestPatternBasedDisposal_InstanceMethod_OptionalParameter() public void TestPatternBasedDisposal_InstanceMethod_OptionalParameter()
{ {
...@@ -1870,7 +1870,7 @@ public async System.Threading.Tasks.ValueTask DisposeAsync(int i = 0) ...@@ -1870,7 +1870,7 @@ public async System.Threading.Tasks.ValueTask DisposeAsync(int i = 0)
CompileAndVerify(comp, expectedOutput: "using dispose_start dispose_end return"); CompileAndVerify(comp, expectedOutput: "using dispose_start dispose_end return");
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
[WorkItem(32316, "https://github.com/dotnet/roslyn/issues/32316")] [WorkItem(32316, "https://github.com/dotnet/roslyn/issues/32316")]
public void TestPatternBasedDisposal_InstanceMethod_ParamsParameter() public void TestPatternBasedDisposal_InstanceMethod_ParamsParameter()
{ {
...@@ -1900,7 +1900,7 @@ public async System.Threading.Tasks.ValueTask DisposeAsync(params int[] x) ...@@ -1900,7 +1900,7 @@ public async System.Threading.Tasks.ValueTask DisposeAsync(params int[] x)
CompileAndVerify(comp, expectedOutput: "using dispose_start dispose_end(0) return"); CompileAndVerify(comp, expectedOutput: "using dispose_start dispose_end(0) return");
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
[WorkItem(32316, "https://github.com/dotnet/roslyn/issues/32316")] [WorkItem(32316, "https://github.com/dotnet/roslyn/issues/32316")]
public void TestPatternBasedDisposal_InstanceMethod_ReturningVoid() public void TestPatternBasedDisposal_InstanceMethod_ReturningVoid()
{ {
...@@ -1928,7 +1928,7 @@ public void DisposeAsync() ...@@ -1928,7 +1928,7 @@ public void DisposeAsync()
); );
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
[WorkItem(32316, "https://github.com/dotnet/roslyn/issues/32316")] [WorkItem(32316, "https://github.com/dotnet/roslyn/issues/32316")]
public void TestPatternBasedDisposal_InstanceMethod_ReturningInt() public void TestPatternBasedDisposal_InstanceMethod_ReturningInt()
{ {
...@@ -1955,7 +1955,7 @@ public int DisposeAsync() ...@@ -1955,7 +1955,7 @@ public int DisposeAsync()
); );
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
[WorkItem(32316, "https://github.com/dotnet/roslyn/issues/32316")] [WorkItem(32316, "https://github.com/dotnet/roslyn/issues/32316")]
public void TestPatternBasedDisposal_InstanceMethod_Inaccessible() public void TestPatternBasedDisposal_InstanceMethod_Inaccessible()
{ {
...@@ -1988,7 +1988,7 @@ private System.Threading.Tasks.ValueTask DisposeAsync() ...@@ -1988,7 +1988,7 @@ private System.Threading.Tasks.ValueTask DisposeAsync()
); );
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
[WorkItem(32316, "https://github.com/dotnet/roslyn/issues/32316")] [WorkItem(32316, "https://github.com/dotnet/roslyn/issues/32316")]
public void TestPatternBasedDisposal_InstanceMethod_UsingDeclaration() public void TestPatternBasedDisposal_InstanceMethod_UsingDeclaration()
{ {
...@@ -2017,7 +2017,7 @@ public async System.Threading.Tasks.ValueTask DisposeAsync() ...@@ -2017,7 +2017,7 @@ public async System.Threading.Tasks.ValueTask DisposeAsync()
CompileAndVerify(comp, expectedOutput: "using dispose_start dispose_end return"); CompileAndVerify(comp, expectedOutput: "using dispose_start dispose_end return");
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
[WorkItem(32316, "https://github.com/dotnet/roslyn/issues/32316")] [WorkItem(32316, "https://github.com/dotnet/roslyn/issues/32316")]
public void TestPatternBasedDisposal_Awaitable() public void TestPatternBasedDisposal_Awaitable()
{ {
...@@ -2057,7 +2057,7 @@ public class Awaiter : System.Runtime.CompilerServices.INotifyCompletion ...@@ -2057,7 +2057,7 @@ public class Awaiter : System.Runtime.CompilerServices.INotifyCompletion
CompileAndVerify(comp, expectedOutput: "using dispose_start dispose_end return"); CompileAndVerify(comp, expectedOutput: "using dispose_start dispose_end return");
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
[WorkItem(32316, "https://github.com/dotnet/roslyn/issues/32316")] [WorkItem(32316, "https://github.com/dotnet/roslyn/issues/32316")]
public void TestPatternBasedDisposal_ReturnsTask() public void TestPatternBasedDisposal_ReturnsTask()
{ {
...@@ -2086,7 +2086,7 @@ public async System.Threading.Tasks.Task DisposeAsync() ...@@ -2086,7 +2086,7 @@ public async System.Threading.Tasks.Task DisposeAsync()
CompileAndVerify(comp, expectedOutput: "using dispose_start dispose_end return"); CompileAndVerify(comp, expectedOutput: "using dispose_start dispose_end return");
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
[WorkItem(32316, "https://github.com/dotnet/roslyn/issues/32316")] [WorkItem(32316, "https://github.com/dotnet/roslyn/issues/32316")]
public void TestPatternBasedDisposal_ReturnsTaskOfInt() public void TestPatternBasedDisposal_ReturnsTaskOfInt()
{ {
...@@ -2117,7 +2117,7 @@ public async System.Threading.Tasks.Task<int> DisposeAsync() ...@@ -2117,7 +2117,7 @@ public async System.Threading.Tasks.Task<int> DisposeAsync()
CompileAndVerify(comp, expectedOutput: "using dispose_start dispose_end return"); CompileAndVerify(comp, expectedOutput: "using dispose_start dispose_end return");
} }
[ConditionalFact(typeof(WindowsDesktopOnly))] [Fact]
public void TestInRegularMethod() public void TestInRegularMethod()
{ {
string source = @" string source = @"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册