Skip to content

Commit

Permalink
Normalize inline source with tabs instead of spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
bradwilson committed Dec 1, 2024
1 parent c7855d1 commit af240fd
Show file tree
Hide file tree
Showing 121 changed files with 3,535 additions and 3,521 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ public async Task DefaultConstructor_DoesNotTrigger()
internal sealed class CustomFactAttribute : FactAttribute { }
public class Tests {
[CustomFact]
public void TestCustomFact() { }
[CustomFact]
public void TestCustomFact() { }
[Fact]
public void TestFact() { }
[Fact]
public void TestFact() { }
}
""";

Expand All @@ -35,17 +35,17 @@ public async Task ParameterlessPublicConstructor_DoesNotTrigger()
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
internal sealed class CustomFactAttribute : FactAttribute {
public CustomFactAttribute() {
this.Skip = "xxx";
}
public CustomFactAttribute() {
this.Skip = "xxx";
}
}
public class Tests {
[CustomFact]
public void TestCustomFact() { }
[CustomFact]
public void TestCustomFact() { }
[Fact]
public void TestFact() { }
[Fact]
public void TestFact() { }
}
""";

Expand All @@ -61,17 +61,17 @@ public async Task PublicConstructorWithParameters_DoesNotTrigger()
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
internal sealed class CustomFactAttribute : FactAttribute {
public CustomFactAttribute(string skip) {
this.Skip = skip;
}
public CustomFactAttribute(string skip) {
this.Skip = skip;
}
}
public class Tests {
[CustomFact("blah")]
public void TestCustomFact() { }
[CustomFact("blah")]
public void TestCustomFact() { }
[Fact]
public void TestFact() { }
[Fact]
public void TestFact() { }
}
""";

Expand All @@ -87,21 +87,21 @@ public async Task PublicConstructorWithOtherConstructors_DoesNotTrigger()
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
internal sealed class CustomFactAttribute : FactAttribute {
public CustomFactAttribute() {
this.Skip = "xxx";
}
public CustomFactAttribute() {
this.Skip = "xxx";
}
internal CustomFactAttribute(string skip) {
this.Skip = skip;
}
internal CustomFactAttribute(string skip) {
this.Skip = skip;
}
}
public class Tests {
[CustomFact]
public void TestCustomFact() { }
[CustomFact]
public void TestCustomFact() { }
[Fact]
public void TestFact() { }
[Fact]
public void TestFact() { }
}
""";

Expand All @@ -117,15 +117,15 @@ public async Task InternalConstructor_Triggers()
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
internal sealed class CustomFactAttribute : FactAttribute {
internal CustomFactAttribute(string skip, params int[] values) { }
internal CustomFactAttribute(string skip, params int[] values) { }
}
public class Tests {
[{|#0:CustomFact("Skip", 42)|}]
public void TestCustomFact() { }
[{|#0:CustomFact("Skip", 42)|}]
public void TestCustomFact() { }
[Fact]
public void TestFact() { }
[Fact]
public void TestFact() { }
}
""";
var expected = Verify.Diagnostic().WithLocation(0).WithArguments("CustomFactAttribute.CustomFactAttribute(string, params int[])");
Expand All @@ -142,17 +142,17 @@ public async Task ProtectedInternalConstructor_Triggers()
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
internal sealed class CustomFactAttribute : FactAttribute {
protected internal CustomFactAttribute() {
this.Skip = "xxx";
}
protected internal CustomFactAttribute() {
this.Skip = "xxx";
}
}
public class Tests {
[{|#0:CustomFact|}]
public void TestCustomFact() { }
[{|#0:CustomFact|}]
public void TestCustomFact() { }
[Fact]
public void TestFact() { }
[Fact]
public void TestFact() { }
}
""";
var expected = Verify.Diagnostic().WithLocation(0).WithArguments("CustomFactAttribute.CustomFactAttribute()");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ public async Task FactMethodWithNoDataAttributes_DoesNotTrigger()
{
var source = /* lang=c#-test */ """
public class TestClass {
[Xunit.Fact]
public void TestMethod() { }
[Xunit.Fact]
public void TestMethod() { }
}
""";

Expand All @@ -25,9 +25,9 @@ public async Task FactMethodWithDataAttributes_DoesNotTrigger(string dataAttribu
{
var source = string.Format(/* lang=c#-test */ """
public class TestClass {{
[Xunit.Fact]
[Xunit.{0}]
public void TestMethod() {{ }}
[Xunit.Fact]
[Xunit.{0}]
public void TestMethod() {{ }}
}}
""", dataAttribute);

Expand All @@ -42,9 +42,9 @@ public async Task TheoryMethodWithDataAttributes_DoesNotTrigger(string dataAttri
{
var source = string.Format(/* lang=c#-test */ """
public class TestClass {{
[Xunit.Theory]
[Xunit.{0}]
public void TestMethod() {{ }}
[Xunit.Theory]
[Xunit.{0}]
public void TestMethod() {{ }}
}}
""", dataAttribute);

Expand All @@ -59,8 +59,8 @@ public async Task MethodsWithDataAttributesButNotFactOrTheory_Triggers(string da
{
var source = string.Format(/* lang=c#-test */ """
public class TestClass {{
[Xunit.{0}]
public void [|TestMethod|]() {{ }}
[Xunit.{0}]
public void [|TestMethod|]() {{ }}
}}
""", dataAttribute);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ public async Task NonTestMethod_DoesNotTrigger()
using System.Threading.Tasks;
public class MyClass {
public async void MyMethod() {
await Task.Yield();
}
public async void MyMethod() {
await Task.Yield();
}
}
""";

Expand All @@ -27,8 +27,8 @@ public async Task NonAsyncTestMethod_DoesNotTrigger()
using Xunit;
public class TestClass {
[Fact]
public void TestMethod() { }
[Fact]
public void TestMethod() { }
}
""";

Expand All @@ -43,10 +43,10 @@ public async Task AsyncTaskMethod_DoesNotTrigger()
using Xunit;
public class TestClass {
[Fact]
public async Task TestMethod() {
await Task.Yield();
}
[Fact]
public async Task TestMethod() {
await Task.Yield();
}
}
""";

Expand All @@ -61,10 +61,10 @@ public async Task AsyncValueTaskMethod_V3_DoesNotTrigger()
using Xunit;
public class TestClass {
[Fact]
public async ValueTask TestMethod() {
await Task.Yield();
}
[Fact]
public async ValueTask TestMethod() {
await Task.Yield();
}
}
""";

Expand All @@ -79,10 +79,10 @@ public async Task AsyncVoidMethod_Triggers()
using Xunit;
public class TestClass {
[Fact]
public async void {|#0:TestMethod|}() {
await Task.Yield();
}
[Fact]
public async void {|#0:TestMethod|}() {
await Task.Yield();
}
}
""";
var expectedV2 = Verify.Diagnostic("xUnit1048").WithLocation(0);
Expand Down
Loading

0 comments on commit af240fd

Please sign in to comment.