@@ -45,11 +45,16 @@ private static void CompareMSBuildWorkspaceCompilation(string csprojContents, Cs
4545 Path . GetFileName ( tree . FilePath ) . EndsWith ( ending , StringComparison . OrdinalIgnoreCase ) ) )
4646 . ToImmutableArray ( ) ;
4747
48+ // Assert that the generated files have the same names in the same order
4849 result . GeneratedSources . SequenceEqual ( sanitizedSyntaxTrees , ( a , b ) =>
49- Path . GetFileName ( a . FilePath ) . Equals ( Path . GetFileName ( b . FilePath ) , StringComparison . OrdinalIgnoreCase )
50- && a . Options . Equals ( b . Options )
51- && a . GetText ( ) . ToString ( ) == b . GetText ( ) . ToString ( ) )
52- . ShouldBeTrue ( ) ;
50+ Path . GetFileName ( a . FilePath ) . Equals ( Path . GetFileName ( b . FilePath ) , StringComparison . OrdinalIgnoreCase ) ) ;
51+
52+ // Assert that the files have the same parse options and contents
53+ foreach ( var ( fastGenerated , msbuildGenerated ) in result . GeneratedSources . Zip ( sanitizedSyntaxTrees ) )
54+ {
55+ fastGenerated . Options . ShouldBe ( msbuildGenerated . Options ) ;
56+ fastGenerated . GetText ( ) . ToString ( ) . ShouldBe ( msbuildGenerated . GetText ( ) . ToString ( ) ) ;
57+ }
5358 }
5459
5560 private static Compilation GetMSBuildWorkspaceCompilation ( string csprojContents )
@@ -209,14 +214,14 @@ public static void ParsesImplicitUsings([Values("true", "enable", "false", "disa
209214 source . FilePath . ShouldBe ( "Test.GlobalUsings.g.cs" ) ;
210215 source . GetText ( ) . ToString ( ) . ShouldBe ( """
211216 // <auto-generated/>
212- global using global:: System;
213- global using global:: System.Collections.Generic;
214- global using global:: System.IO;
215- global using global:: System.Linq;
216- global using global:: System.Net.Http;
217- global using global:: System.Threading;
218- global using global:: System.Threading.Tasks;
219-
217+ global using System;
218+ global using System.Collections.Generic;
219+ global using System.IO;
220+ global using System.Linq;
221+ global using System.Net.Http;
222+ global using System.Threading;
223+ global using System.Threading.Tasks;
224+
220225 """ ) ;
221226 }
222227 else
0 commit comments