Skip to content

Commit

Permalink
ignore CS0618 for tests (#276)
Browse files Browse the repository at this point in the history
  • Loading branch information
sailro authored Mar 13, 2023
1 parent 5afcb00 commit 634b901
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -250,10 +250,14 @@ public Transform NP()
}
";

var context = AnalyzerVerificationContext
.Default // see https://github.com/Unity-Technologies/UnityCsReference/blob/master/Runtime/Export/Scripting/UnityEngineObject.bindings.cs
.WithAnalyzerFilter("CS0618"); // ignore Unity 2023.x warning CS0618 for now: 'Object.FindObjectOfType<T>()' is obsolete'

var diagnostic = ExpectDiagnostic(UnityObjectNullHandlingAnalyzer.NullPropagationRule)
.WithLocation(8, 9);

await VerifyCSharpDiagnosticAsync(test, diagnostic);
await VerifyCSharpDiagnosticAsync(context, test, diagnostic);

// we cannot fix with side-effects
await VerifyCSharpFixAsync(test, test);
Expand Down

0 comments on commit 634b901

Please sign in to comment.