@@ -22,21 +22,19 @@ public SatelliteAssembliesTests(ITestOutputHelper output, SharedBuildPerTestClas
2222 public static IEnumerable < object ? [ ] > SatelliteAssemblyTestData ( bool aot , bool relinking , RunHost host )
2323 => ConfigWithAOTData ( aot )
2424 . Multiply (
25- new object ? [ ] { relinking , "es-ES" , "got: hola" } ,
26- new object ? [ ] { relinking , null , "got: hello" } ,
27- new object ? [ ] { relinking , "ja-JP" , "got: \u3053 \u3093 \u306B \u3061 \u306F " } )
25+ new object ? [ ] { relinking , "es-ES" } ,
26+ new object ? [ ] { relinking , null } ,
27+ new object ? [ ] { relinking , "ja-JP" } )
2828 . WithRunHosts ( host )
2929 . UnwrapItemsAsArrays ( ) ;
3030
3131 [ Theory ]
32- [ ActiveIssue ( "https://github.com/dotnet/runtime/issues/61725" , TestPlatforms . Windows ) ]
3332 [ MemberData ( nameof ( SatelliteAssemblyTestData ) , parameters : new object [ ] { /*aot*/ false , /*relinking*/ false , RunHost . All } ) ]
3433 [ MemberData ( nameof ( SatelliteAssemblyTestData ) , parameters : new object [ ] { /*aot*/ false , /*relinking*/ true , RunHost . All } ) ]
3534 [ MemberData ( nameof ( SatelliteAssemblyTestData ) , parameters : new object [ ] { /*aot*/ true , /*relinking*/ false , RunHost . All } ) ]
3635 public void ResourcesFromMainAssembly ( BuildArgs buildArgs ,
3736 bool nativeRelink ,
3837 string ? argCulture ,
39- string expectedOutput ,
4038 RunHost host ,
4139 string id )
4240 {
@@ -62,25 +60,21 @@ public void ResourcesFromMainAssembly(BuildArgs buildArgs,
6260 } ,
6361 DotnetWasmFromRuntimePack : dotnetWasmFromRuntimePack ) ) ;
6462
65- string output = RunAndTestWasmApp (
66- buildArgs , expectedExitCode : 42 ,
67- args : argCulture ,
68- host : host , id : id ,
69- // check that downloading assets doesn't have timing race conditions
70- extraXHarnessMonoArgs : "--fetch-random-delay=200" ) ;
71-
72- Assert . Contains ( expectedOutput , output ) ;
63+ RunAndTestWasmApp (
64+ buildArgs , expectedExitCode : 42 ,
65+ args : argCulture ,
66+ host : host , id : id ,
67+ // check that downloading assets doesn't have timing race conditions
68+ extraXHarnessMonoArgs : "--fetch-random-delay=200" ) ;
7369 }
7470
7571 [ Theory ]
76- [ ActiveIssue ( "https://github.com/dotnet/runtime/issues/61725" , TestPlatforms . Windows ) ]
7772 [ MemberData ( nameof ( SatelliteAssemblyTestData ) , parameters : new object [ ] { /*aot*/ false , /*relinking*/ false , RunHost . All } ) ]
7873 [ MemberData ( nameof ( SatelliteAssemblyTestData ) , parameters : new object [ ] { /*aot*/ false , /*relinking*/ true , RunHost . All } ) ]
7974 [ MemberData ( nameof ( SatelliteAssemblyTestData ) , parameters : new object [ ] { /*aot*/ true , /*relinking*/ false , RunHost . All } ) ]
8075 public void ResourcesFromProjectReference ( BuildArgs buildArgs ,
8176 bool nativeRelink ,
8277 string ? argCulture ,
83- string expectedOutput ,
8478 RunHost host ,
8579 string id )
8680 {
@@ -107,12 +101,10 @@ public void ResourcesFromProjectReference(BuildArgs buildArgs,
107101 CreateProgramForCultureTest ( _projectDir , "LibraryWithResources.resx.words" , "LibraryWithResources.Class1" ) ;
108102 } ) ) ;
109103
110- string output = RunAndTestWasmApp ( buildArgs ,
111- expectedExitCode : 42 ,
112- args : argCulture ,
113- host : host , id : id ) ;
114-
115- Assert . Contains ( expectedOutput , output ) ;
104+ RunAndTestWasmApp ( buildArgs ,
105+ expectedExitCode : 42 ,
106+ args : argCulture ,
107+ host : host , id : id ) ;
116108 }
117109
118110#pragma warning disable xUnit1026
@@ -180,20 +172,31 @@ public class TestClass
180172 {
181173 public static int Main(string[] args)
182174 {
175+ string expected;
183176 if (args.Length == 1)
184177 {
185178 string cultureToTest = args[0];
186179 var newCulture = new CultureInfo(cultureToTest);
187180 Thread.CurrentThread.CurrentCulture = newCulture;
188181 Thread.CurrentThread.CurrentUICulture = newCulture;
182+
183+ if (cultureToTest == ""es-ES"")
184+ expected = ""hola"";
185+ else if (cultureToTest == ""ja-JP"")
186+ expected = ""\u3053\u3093\u306B\u3061\u306F"";
187+ else
188+ throw new Exception(""Cannot determine the expected output for {cultureToTest}"");
189+
190+ } else {
191+ expected = ""hello"";
189192 }
190193
191194 var currentCultureName = Thread.CurrentThread.CurrentCulture.Name;
192195
193196 var rm = new ResourceManager(""##RESOURCE_NAME##"", typeof(##TYPE_NAME##).Assembly);
194197 Console.WriteLine($""For '{currentCultureName}' got: {rm.GetString(""hello"")}"");
195198
196- return 42 ;
199+ return rm.GetString(""hello"") == expected ? 42 : -1 ;
197200 }
198201 }
199202}" ;
0 commit comments