File tree Expand file tree Collapse file tree
src/Workspaces/CoreTest/SolutionTests Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2566,6 +2566,31 @@ public void TestProjectWithBrokenCrossLanguageReferenceHasIncompleteReferences()
25662566 Assert . Empty ( project2 . GetCompilationAsync ( ) . Result . ExternalReferences ) ;
25672567 }
25682568
2569+ [ Fact ]
2570+ public async Task TestFrozenPartialProjectHasDifferentSemanticVersions ( )
2571+ {
2572+ using var workspace = CreateWorkspaceWithPartalSemantics ( ) ;
2573+ var project = workspace . CurrentSolution . AddProject ( "CSharpProject" , "CSharpProject" , LanguageNames . CSharp ) ;
2574+ project = project . AddDocument ( "Extra.cs" , SourceText . From ( "class Extra { }" ) ) . Project ;
2575+
2576+ var documentToFreeze = project . AddDocument ( "DocumentToFreeze.cs" , SourceText . From ( "" ) ) ;
2577+ var frozenDocument = documentToFreeze . WithFrozenPartialSemantics ( CancellationToken . None ) ;
2578+
2579+ // Because we had no compilation produced yet, we expect that only the DocumentToFreeze is in the compilation
2580+ Assert . NotSame ( frozenDocument , documentToFreeze ) ;
2581+ var tree = Assert . Single ( ( await frozenDocument . Project . GetCompilationAsync ( ) ) . SyntaxTrees ) ;
2582+ Assert . Equal ( "DocumentToFreeze.cs" , tree . FilePath ) ;
2583+
2584+ // Versions should be different
2585+ Assert . NotEqual (
2586+ await documentToFreeze . Project . GetDependentSemanticVersionAsync ( ) ,
2587+ await frozenDocument . Project . GetDependentSemanticVersionAsync ( ) ) ;
2588+
2589+ Assert . NotEqual (
2590+ await documentToFreeze . Project . GetSemanticVersionAsync ( ) ,
2591+ await frozenDocument . Project . GetSemanticVersionAsync ( ) ) ;
2592+ }
2593+
25692594 [ Fact ]
25702595 public void TestFrozenPartialProjectAlwaysIsIncomplete ( )
25712596 {
You can’t perform that action at this time.
0 commit comments