@@ -150,13 +150,35 @@ public void PackageWithoutAssets_ShouldNotShowUpInDepsJson()
150150 var buildCommand = new BuildCommand ( testAsset ) ;
151151 buildCommand . Execute ( ) . Should ( ) . Pass ( ) ;
152152
153- using ( var depsJsonFileStream = File . OpenRead ( Path . Combine ( buildCommand . GetOutputDirectory ( ToolsetInfo . CurrentTargetFramework ) . FullName , "PackageWithoutAssets_ShouldNotShowUpInDepsJson .deps.json") ) )
153+ using ( var depsJsonFileStream = File . OpenRead ( Path . Combine ( buildCommand . GetOutputDirectory ( ToolsetInfo . CurrentTargetFramework ) . FullName , $ " { testProject . Name } .deps.json") ) )
154154 {
155155 var dependencyContext = new DependencyContextJsonReader ( ) . Read ( depsJsonFileStream ) ;
156156 dependencyContext . RuntimeLibraries . Any ( l => l . Name . Equals ( "Nerdbank.GitVersioning" ) ) . Should ( ) . BeFalse ( ) ;
157157 }
158158 }
159159
160+ [ Fact ]
161+ public void XUnitCoreIsNotTrimmed ( )
162+ {
163+ // Regression test for https://github.com/dotnet/sdk/issues/49248
164+
165+ var testProject = new TestProject ( ) ;
166+ testProject . PackageReferences . Add ( new TestPackageReference ( "xunit.core" , "2.9.3" ) ) ;
167+ testProject . PackageReferences . Add ( new TestPackageReference ( "xunit.extensibility.core" , "2.9.3" ) ) ;
168+ testProject . PackageReferences . Add ( new TestPackageReference ( "xunit.extensibility.execution" , "2.9.3" ) ) ;
169+
170+ var testAsset = _testAssetsManager . CreateTestProject ( testProject ) ;
171+
172+ var buildCommand = new BuildCommand ( testAsset ) ;
173+ buildCommand . Execute ( ) . Should ( ) . Pass ( ) ;
174+
175+ using ( var depsJsonFileStream = File . OpenRead ( Path . Combine ( buildCommand . GetOutputDirectory ( ToolsetInfo . CurrentTargetFramework ) . FullName , $ "{ testProject . Name } .deps.json") ) )
176+ {
177+ var dependencyContext = new DependencyContextJsonReader ( ) . Read ( depsJsonFileStream ) ;
178+ dependencyContext . RuntimeLibraries . Any ( l => l . Name . Equals ( "xunit.core" ) ) . Should ( ) . BeTrue ( ) ;
179+ }
180+ }
181+
160182 [ Fact ]
161183 public void ProjectNameCanMatchPackageReferenceName ( )
162184 {
0 commit comments