@@ -150,13 +150,35 @@ public void PackageWithoutAssets_ShouldNotShowUpInDepsJson()
150
150
var buildCommand = new BuildCommand ( testAsset ) ;
151
151
buildCommand . Execute ( ) . Should ( ) . Pass ( ) ;
152
152
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") ) )
154
154
{
155
155
var dependencyContext = new DependencyContextJsonReader ( ) . Read ( depsJsonFileStream ) ;
156
156
dependencyContext . RuntimeLibraries . Any ( l => l . Name . Equals ( "Nerdbank.GitVersioning" ) ) . Should ( ) . BeFalse ( ) ;
157
157
}
158
158
}
159
159
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
+
160
182
[ Fact ]
161
183
public void ProjectNameCanMatchPackageReferenceName ( )
162
184
{
0 commit comments