diff --git a/tools/ExampleTester.Tests/FastCsprojCompilationParserTests.cs b/tools/ExampleTester.Tests/FastCsprojCompilationParserTests.cs
index c07faaf74..db4d1f94f 100644
--- a/tools/ExampleTester.Tests/FastCsprojCompilationParserTests.cs
+++ b/tools/ExampleTester.Tests/FastCsprojCompilationParserTests.cs
@@ -45,11 +45,16 @@ private static void CompareMSBuildWorkspaceCompilation(string csprojContents, Cs
Path.GetFileName(tree.FilePath).EndsWith(ending, StringComparison.OrdinalIgnoreCase)))
.ToImmutableArray();
+ // Assert that the generated files have the same names in the same order
result.GeneratedSources.SequenceEqual(sanitizedSyntaxTrees, (a, b) =>
- Path.GetFileName(a.FilePath).Equals(Path.GetFileName(b.FilePath), StringComparison.OrdinalIgnoreCase)
- && a.Options.Equals(b.Options)
- && a.GetText().ToString() == b.GetText().ToString())
- .ShouldBeTrue();
+ Path.GetFileName(a.FilePath).Equals(Path.GetFileName(b.FilePath), StringComparison.OrdinalIgnoreCase));
+
+ // Assert that the files have the same parse options and contents
+ foreach (var (fastGenerated, msbuildGenerated) in result.GeneratedSources.Zip(sanitizedSyntaxTrees))
+ {
+ fastGenerated.Options.ShouldBe(msbuildGenerated.Options);
+ fastGenerated.GetText().ToString().ShouldBe(msbuildGenerated.GetText().ToString());
+ }
}
private static Compilation GetMSBuildWorkspaceCompilation(string csprojContents)
@@ -209,14 +214,14 @@ public static void ParsesImplicitUsings([Values("true", "enable", "false", "disa
source.FilePath.ShouldBe("Test.GlobalUsings.g.cs");
source.GetText().ToString().ShouldBe("""
//
- global using global::System;
- global using global::System.Collections.Generic;
- global using global::System.IO;
- global using global::System.Linq;
- global using global::System.Net.Http;
- global using global::System.Threading;
- global using global::System.Threading.Tasks;
-
+ global using System;
+ global using System.Collections.Generic;
+ global using System.IO;
+ global using System.Linq;
+ global using System.Net.Http;
+ global using System.Threading;
+ global using System.Threading.Tasks;
+
""");
}
else
diff --git a/tools/ExampleTester/FastCsprojCompilationParser.cs b/tools/ExampleTester/FastCsprojCompilationParser.cs
index 51c7f1098..0592a5858 100644
--- a/tools/ExampleTester/FastCsprojCompilationParser.cs
+++ b/tools/ExampleTester/FastCsprojCompilationParser.cs
@@ -134,13 +134,13 @@ public static CsprojParseResult ParseCsproj(XDocument csprojDocument, string fil
{
generatedSources.Add(SyntaxFactory.ParseSyntaxTree("""
//
- global using global::System;
- global using global::System.Collections.Generic;
- global using global::System.IO;
- global using global::System.Linq;
- global using global::System.Net.Http;
- global using global::System.Threading;
- global using global::System.Threading.Tasks;
+ global using System;
+ global using System.Collections.Generic;
+ global using System.IO;
+ global using System.Linq;
+ global using System.Net.Http;
+ global using System.Threading;
+ global using System.Threading.Tasks;
""",
parseOptions,