dotnet / roslyn-analyzers

MIT License
1.56k stars 462 forks source link

DoNotDirectlyAwaitATaskTests.Fixer has invalid Fix All results #2310

Open sharwell opened 5 years ago

sharwell commented 5 years ago

See these tests:

https://github.com/dotnet/roslyn-analyzers/blob/2f94c36db114d8ab2517939c01e4390806c95cdb/src/Microsoft.CodeQuality.Analyzers/UnitTests/ApiDesignGuidelines/DoNotDirectlyAwaitATaskTests.Fixer.cs#L260-L261

https://github.com/dotnet/roslyn-analyzers/blob/2f94c36db114d8ab2517939c01e4390806c95cdb/src/Microsoft.CodeQuality.Analyzers/UnitTests/ApiDesignGuidelines/DoNotDirectlyAwaitATaskTests.Fixer.cs#L317-L318

Evangelink commented 4 years ago

That's weird because commenting out the following part of the test https://github.com/dotnet/roslyn-analyzers/blob/2f94c36db114d8ab2517939c01e4390806c95cdb/src/Microsoft.CodeQuality.Analyzers/UnitTests/ApiDesignGuidelines/DoNotDirectlyAwaitATaskTests.Fixer.cs#L255-L263 leads to a wrong behavior in the fixedCode.