Skip to content

Commit

Permalink
Add tests with surrogate pairs
Browse files Browse the repository at this point in the history
  • Loading branch information
lewing committed Sep 9, 2024
1 parent 77cefac commit 0700827
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/mono/wasm/Wasm.Build.Tests/PInvokeTableGeneratorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,8 @@ public unsafe static int Main()
{
((delegate* unmanaged<void>)&A.Conflict.C)();
((delegate* unmanaged<void>)&B.Conflict.C)();
((delegate* unmanaged<void>)&A.Conflict.C\U0001F412)();
((delegate* unmanaged<void>)&B.Conflict.C\U0001F412)();
return 42;
}
}
Expand All @@ -462,6 +464,11 @@ public class Conflict {
public static void C() {
Console.WriteLine("A.Conflict.C");
}

[UnmanagedCallersOnly(EntryPoint = "A_Conflict_C\U0001F412")]
public static void C\U0001F412() {
Console.WriteLine("A.Conflict.C\U0001F412");
}
}
}

Expand All @@ -471,6 +478,11 @@ public class Conflict {
public static void C() {
Console.WriteLine("B.Conflict.C");
}

[UnmanagedCallersOnly(EntryPoint = "B_Conflict_C\U0001F412")]
public static void C\U0001F412() {
Console.WriteLine("B.Conflict.C\U0001F412");
}
}
}
""";
Expand All @@ -486,6 +498,8 @@ public static void C() {
output = RunAndTestWasmApp(buildArgs, buildDir: _projectDir, expectedExitCode: 42, host: host, id: id);
Assert.Contains("A.Conflict.C", output);
Assert.Contains("B.Conflict.C", output);
Assert.Contains("A.Conflict.C\U0001F412", output);
Assert.Contains("B.Conflict.C\U0001F412", output);
}

[Theory]
Expand Down

0 comments on commit 0700827

Please sign in to comment.