@@ -82,13 +82,13 @@ public class MyBehaviour : MonoBehaviour
8282{
8383 void Update()
8484 {
85- var list = new System.Collections.Generic.List<int>();
85+ var list = {|#0: new System.Collections.Generic.List<int>()|} ;
8686 }
8787}
8888" ;
8989
9090 var expected = new DiagnosticResult ( ObjectPoolAnalyzer . DiagnosticId , DiagnosticSeverity . Warning )
91- . WithSpan ( 8 , 20 , 8 , 62 )
91+ . WithLocation ( 0 )
9292 . WithArguments ( "Update" , "System.Collections.Generic.List<int>" ) ;
9393
9494 await VerifyAnalyzerAsync ( source , expected ) ;
@@ -105,13 +105,13 @@ public class MyBehaviour : MonoBehaviour
105105 public Object prefab;
106106 void Update()
107107 {
108- Object.Instantiate(prefab);
108+ {|#0: Object.Instantiate(prefab)|} ;
109109 }
110110}
111111" ;
112112
113113 var expected = new DiagnosticResult ( ObjectPoolAnalyzer . DiagnosticId , DiagnosticSeverity . Warning )
114- . WithSpan ( 9 , 9 , 9 , 35 )
114+ . WithLocation ( 0 )
115115 . WithArguments ( "Update" , "Instantiate" ) ;
116116
117117 await VerifyAnalyzerAsync ( source , expected ) ;
@@ -181,13 +181,13 @@ public class MyBehaviour : MonoBehaviour
181181{
182182 void FixedUpdate()
183183 {
184- var list = new System.Collections.Generic.List<int>();
184+ var list = {|#0: new System.Collections.Generic.List<int>()|} ;
185185 }
186186}
187187" ;
188188
189189 var expected = new DiagnosticResult ( ObjectPoolAnalyzer . DiagnosticId , DiagnosticSeverity . Warning )
190- . WithSpan ( 8 , 20 , 8 , 62 )
190+ . WithLocation ( 0 )
191191 . WithArguments ( "FixedUpdate" , "System.Collections.Generic.List<int>" ) ;
192192
193193 await VerifyAnalyzerAsync ( source , expected ) ;
@@ -383,13 +383,13 @@ public class MyBehaviour : MonoBehaviour
383383{
384384 void OnTriggerStay(Collider other)
385385 {
386- var list = new System.Collections.Generic.List<int>();
386+ var list = {|#0: new System.Collections.Generic.List<int>()|} ;
387387 }
388388}
389389" ;
390390
391391 var expected = new DiagnosticResult ( ObjectPoolAnalyzer . DiagnosticId , DiagnosticSeverity . Warning )
392- . WithSpan ( 8 , 20 , 8 , 62 )
392+ . WithLocation ( 0 )
393393 . WithArguments ( "OnTriggerStay" , "System.Collections.Generic.List<int>" ) ;
394394
395395 await VerifyAnalyzerAsync ( source , expected ) ;
@@ -441,13 +441,13 @@ public class MyBehaviour : MonoBehaviour
441441{
442442 void OnCollisionStay2D(Collision2D collision)
443443 {
444- var list = new System.Collections.Generic.List<int>();
444+ var list = {|#0: new System.Collections.Generic.List<int>()|} ;
445445 }
446446}
447447" ;
448448
449449 var expected = new DiagnosticResult ( ObjectPoolAnalyzer . DiagnosticId , DiagnosticSeverity . Warning )
450- . WithSpan ( 8 , 20 , 8 , 62 )
450+ . WithLocation ( 0 )
451451 . WithArguments ( "OnCollisionStay2D" , "System.Collections.Generic.List<int>" ) ;
452452
453453 await VerifyAnalyzerAsync ( source , expected ) ;
@@ -463,13 +463,13 @@ public class MyBehaviour : MonoBehaviour
463463{
464464 void OnAnimatorIK(int layerIndex)
465465 {
466- var list = new System.Collections.Generic.List<int>();
466+ var list = {|#0: new System.Collections.Generic.List<int>()|} ;
467467 }
468468}
469469" ;
470470
471471 var expected = new DiagnosticResult ( ObjectPoolAnalyzer . DiagnosticId , DiagnosticSeverity . Warning )
472- . WithSpan ( 8 , 20 , 8 , 62 )
472+ . WithLocation ( 0 )
473473 . WithArguments ( "OnAnimatorIK" , "System.Collections.Generic.List<int>" ) ;
474474
475475 await VerifyAnalyzerAsync ( source , expected ) ;
@@ -613,13 +613,13 @@ public class MyBehaviour : UnityEngine.MonoBehaviour
613613{
614614 void Update()
615615 {
616- var list = new System.Collections.Generic.List<int>();
616+ var list = {|#0: new System.Collections.Generic.List<int>()|} ;
617617 }
618618}
619619" ;
620620
621621 var expected = new DiagnosticResult ( ObjectPoolAnalyzer . DiagnosticId , DiagnosticSeverity . Warning )
622- . WithSpan ( 11 , 20 , 11 , 62 )
622+ . WithLocation ( 0 )
623623 . WithArguments ( "Update" , "System.Collections.Generic.List<int>" ) ;
624624
625625 await VerifyWithoutUnityAsync ( source , expected ) ;
0 commit comments