Skip to content

Commit 2bb665a

Browse files
committed
Add tests with surrogate pairs
1 parent 77cefac commit 2bb665a

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/mono/wasm/Wasm.Build.Tests/PInvokeTableGeneratorTests.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,8 @@ public unsafe static int Main()
452452
{
453453
((delegate* unmanaged<void>)&A.Conflict.C)();
454454
((delegate* unmanaged<void>)&B.Conflict.C)();
455+
((delegate* unmanaged<void>)&A.Conflict.C\U0001F412)();
456+
((delegate* unmanaged<void>)&B.Conflict.C\U0001F412)();
455457
return 42;
456458
}
457459
}
@@ -462,6 +464,11 @@ public class Conflict {
462464
public static void C() {
463465
Console.WriteLine("A.Conflict.C");
464466
}
467+
468+
[UnmanagedCallersOnly(EntryPoint = "A_Conflict_C\U0001F412")]
469+
public static void C\U0001F412() {
470+
Console.WriteLine("A.Conflict.C\U0001F412");
471+
}
465472
}
466473
}
467474
@@ -471,6 +478,11 @@ public class Conflict {
471478
public static void C() {
472479
Console.WriteLine("B.Conflict.C");
473480
}
481+
482+
[UnmanagedCallersOnly(EntryPoint = "A_Conflict_C\U0001F412")]
483+
public static void C\U0001F412() {
484+
Console.WriteLine("B.Conflict.C\U0001F412");
485+
}
474486
}
475487
}
476488
""";
@@ -486,6 +498,8 @@ public static void C() {
486498
output = RunAndTestWasmApp(buildArgs, buildDir: _projectDir, expectedExitCode: 42, host: host, id: id);
487499
Assert.Contains("A.Conflict.C", output);
488500
Assert.Contains("B.Conflict.C", output);
501+
Assert.Contains("A.Conflict.C\U0001F412", output);
502+
Assert.Contains("B.Conflict.C\U0001F412", output);
489503
}
490504

491505
[Theory]

0 commit comments

Comments
 (0)