@@ -41,8 +41,6 @@ public abstract class ProjectProviderBase(ITestOutputHelper _testOutput, string?
4141
4242 public bool IsFingerprintingEnabled => EnvironmentVariables . UseFingerprinting ;
4343
44- public bool IsFingerprintingOnDotnetJsEnabled => EnvironmentVariables . UseFingerprintingDotnetJS ;
45-
4644 // Returns the actual files on disk
4745 public IReadOnlyDictionary < string , DotNetFileName > AssertBasicBundle ( AssertBundleOptions assertOptions )
4846 {
@@ -82,7 +80,6 @@ public IReadOnlyDictionary<string, DotNetFileName> FindAndAssertDotnetFiles(Asse
8280 {
8381 EnsureProjectDirIsSet ( ) ;
8482 return FindAndAssertDotnetFiles ( binFrameworkDir : assertOptions . BinFrameworkDir ,
85- expectFingerprintOnDotnetJs : IsFingerprintingOnDotnetJsEnabled ,
8683 assertOptions ,
8784 superSet : GetAllKnownDotnetFilesToFingerprintMap ( assertOptions ) ,
8885 expected : GetDotNetFilesExpectedSet ( assertOptions )
@@ -94,11 +91,11 @@ public IReadOnlyDictionary<string, DotNetFileName> FindAndAssertDotnetFiles(Asse
9491
9592 public IReadOnlyDictionary < string , DotNetFileName > FindAndAssertDotnetFiles (
9693 string binFrameworkDir ,
97- bool expectFingerprintOnDotnetJs ,
9894 AssertBundleOptions assertOptions ,
9995 IReadOnlyDictionary < string , bool > superSet ,
10096 IReadOnlySet < string > expected )
10197 {
98+ var expectFingerprintOnDotnetJs = assertOptions . ExpectDotnetJsFingerprinting ;
10299 EnsureProjectDirIsSet ( ) ;
103100 var actual = new SortedDictionary < string , DotNetFileName > ( ) ;
104101
@@ -109,6 +106,9 @@ public IReadOnlyDictionary<string, DotNetFileName> FindAndAssertDotnetFiles(
109106 SearchOption . TopDirectoryOnly )
110107 . Order ( )
111108 . ToList ( ) ;
109+
110+ var comparisonLogging = new List < string > ( ) ;
111+
112112 foreach ( ( string expectedFilename , bool expectFingerprint ) in superSet . OrderByDescending ( kvp => kvp . Key ) )
113113 {
114114 string prefix = Path . GetFileNameWithoutExtension ( expectedFilename ) ;
@@ -121,7 +121,7 @@ public IReadOnlyDictionary<string, DotNetFileName> FindAndAssertDotnetFiles(
121121 return false ;
122122
123123 string actualFilename = Path . GetFileName ( actualFile ) ;
124- // _testOutput.WriteLine ($"Comparing {expectedFilename} with {actualFile}, expectFingerprintOnDotnetJs: {expectFingerprintOnDotnetJs }, expectFingerprint: {expectFingerprint}");
124+ comparisonLogging . Add ( $ "Comparing { expectedFilename } with { actualFile } , expectFingerprint: { expectFingerprint } ") ;
125125 if ( ShouldCheckFingerprint ( expectedFilename : expectedFilename ,
126126 expectFingerprintOnDotnetJs : expectFingerprintOnDotnetJs ,
127127 expectFingerprintForThisFile : expectFingerprint ) )
@@ -149,12 +149,18 @@ public IReadOnlyDictionary<string, DotNetFileName> FindAndAssertDotnetFiles(
149149 } ) . ToList ( ) ;
150150 }
151151
152- // _testOutput.WriteLine($"Accepted count: {actual.Count}");
153- // foreach (var kvp in actual)
154- // _testOutput.WriteLine($"Accepted: \t[{kvp.Key}] = {kvp.Value}");
155-
156152 if ( dotnetFiles . Any ( ) )
157153 {
154+ foreach ( var message in comparisonLogging )
155+ {
156+ _testOutput . WriteLine ( message ) ;
157+ }
158+ _testOutput . WriteLine ( $ "Accepted count: { actual . Count } ") ;
159+ foreach ( var kvp in actual )
160+ {
161+ _testOutput . WriteLine ( $ "Accepted: \t [{ kvp . Key } ] = { kvp . Value } ") ;
162+ }
163+
158164 throw new XunitException ( $ "Found unknown files in { binFrameworkDir } :{ Environment . NewLine } " +
159165 $ "{ string . Join ( $ "{ Environment . NewLine } ", dotnetFiles . Select ( f => Path . GetRelativePath ( binFrameworkDir , f ) ) ) } { Environment . NewLine } " +
160166 $ "Add these to { nameof ( GetAllKnownDotnetFilesToFingerprintMap ) } method{ Environment . NewLine } " +
@@ -173,7 +179,7 @@ private void AssertDotNetFilesSet(
173179 IReadOnlySet < string > expected ,
174180 IReadOnlyDictionary < string , bool > superSet ,
175181 IReadOnlyDictionary < string , DotNetFileName > actualReadOnly ,
176- bool expectFingerprintOnDotnetJs ,
182+ bool ? expectFingerprintOnDotnetJs ,
177183 string bundleDir )
178184 {
179185 EnsureProjectDirIsSet ( ) ;
@@ -399,8 +405,8 @@ private string[] GetFilesMatchingNameConsideringFingerprinting(string filePath,
399405 return dict ;
400406 }
401407
402- public bool ShouldCheckFingerprint ( string expectedFilename , bool expectFingerprintOnDotnetJs , bool expectFingerprintForThisFile )
403- => IsFingerprintingEnabled && ( ( expectedFilename == "dotnet.js" && expectFingerprintOnDotnetJs ) || expectFingerprintForThisFile ) ;
408+ public bool ShouldCheckFingerprint ( string expectedFilename , bool ? expectFingerprintOnDotnetJs , bool expectFingerprintForThisFile )
409+ => IsFingerprintingEnabled && ( ( expectedFilename == "dotnet.js" && expectFingerprintOnDotnetJs == true ) || expectFingerprintForThisFile ) ;
404410
405411
406412 public static void AssertRuntimePackPath ( string buildOutput , string targetFramework , RuntimeVariant runtimeType = RuntimeVariant . SingleThreaded )
@@ -577,7 +583,7 @@ public BootJsonData AssertBootJson(AssertBundleOptions options)
577583 string extension = Path . GetExtension ( expectedFilename ) . Substring ( 1 ) ;
578584
579585 if ( ShouldCheckFingerprint ( expectedFilename : expectedFilename ,
580- expectFingerprintOnDotnetJs : IsFingerprintingOnDotnetJsEnabled ,
586+ expectFingerprintOnDotnetJs : options . ExpectDotnetJsFingerprinting ,
581587 expectFingerprintForThisFile : expectFingerprint ) )
582588 {
583589 return Regex . Match ( item , $ "{ prefix } { s_dotnetVersionHashRegex } { extension } ") . Success ;
0 commit comments