aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Tests/HLE/SoftwareKeyboardTests.cs
diff options
context:
space:
mode:
authorTSR Berry <20988865+TSRBerry@users.noreply.github.com>2023-04-08 01:22:00 +0200
committerMary <thog@protonmail.com>2023-04-27 23:51:14 +0200
commitcee712105850ac3385cd0091a923438167433f9f (patch)
tree4a5274b21d8b7f938c0d0ce18736d3f2993b11b1 /Ryujinx.Tests/HLE/SoftwareKeyboardTests.cs
parentcd124bda587ef09668a971fa1cac1c3f0cfc9f21 (diff)
Move solution and projects to src
Diffstat (limited to 'Ryujinx.Tests/HLE/SoftwareKeyboardTests.cs')
-rw-r--r--Ryujinx.Tests/HLE/SoftwareKeyboardTests.cs71
1 files changed, 0 insertions, 71 deletions
diff --git a/Ryujinx.Tests/HLE/SoftwareKeyboardTests.cs b/Ryujinx.Tests/HLE/SoftwareKeyboardTests.cs
deleted file mode 100644
index d16039ad..00000000
--- a/Ryujinx.Tests/HLE/SoftwareKeyboardTests.cs
+++ /dev/null
@@ -1,71 +0,0 @@
-using NUnit.Framework;
-using Ryujinx.HLE.HOS.Applets;
-using System.Text;
-
-namespace Ryujinx.Tests.HLE
-{
- public class SoftwareKeyboardTests
- {
- [Test]
- public void StripUnicodeControlCodes_NullInput()
- {
- Assert.IsNull(SoftwareKeyboardApplet.StripUnicodeControlCodes(null));
- }
-
- [Test]
- public void StripUnicodeControlCodes_EmptyInput()
- {
- Assert.AreEqual(string.Empty, SoftwareKeyboardApplet.StripUnicodeControlCodes(string.Empty));
- }
-
- [Test]
- public void StripUnicodeControlCodes_Passthrough()
- {
- string[] prompts = new string[]
- {
- "Please name him.",
- "Name her, too.",
- "Name your friend.",
- "Name another friend.",
- "Name your pet.",
- "Favorite homemade food?",
- "What’s your favorite thing?",
- "Are you sure?",
- };
-
- foreach (string prompt in prompts)
- {
- Assert.AreEqual(prompt, SoftwareKeyboardApplet.StripUnicodeControlCodes(prompt));
- }
- }
-
- [Test]
- public void StripUnicodeControlCodes_StripsNewlines()
- {
- Assert.AreEqual("I am very tall", SoftwareKeyboardApplet.StripUnicodeControlCodes("I \r\nam \r\nvery \r\ntall"));
- }
-
- [Test]
- public void StripUnicodeControlCodes_StripsDeviceControls()
- {
- // 0x13 is control code DC3 used by some games
- string specialInput = Encoding.UTF8.GetString(new byte[] { 0x13, 0x53, 0x68, 0x69, 0x6E, 0x65, 0x13 });
- Assert.AreEqual("Shine", SoftwareKeyboardApplet.StripUnicodeControlCodes(specialInput));
- }
-
- [Test]
- public void StripUnicodeControlCodes_StripsToEmptyString()
- {
- string specialInput = Encoding.UTF8.GetString(new byte[] { 17, 18, 19, 20 }); // DC1 - DC4 special codes
- Assert.AreEqual(string.Empty, SoftwareKeyboardApplet.StripUnicodeControlCodes(specialInput));
- }
-
- [Test]
- public void StripUnicodeControlCodes_PreservesMultiCodePoints()
- {
- // Turtles are a good example of multi-codepoint Unicode chars
- string specialInput = "♀ 🐢 🐢 ♂ ";
- Assert.AreEqual(specialInput, SoftwareKeyboardApplet.StripUnicodeControlCodes(specialInput));
- }
- }
-}