From 98c83ae9721d0018988518b531c4dd18af715483 Mon Sep 17 00:00:00 2001 From: Leonetienne Date: Sat, 4 Dec 2021 20:36:24 +0100 Subject: added umlaut support for Lower/Upper for îíì MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- StringTools/Test/Upper.cpp | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) (limited to 'StringTools/Test/Upper.cpp') diff --git a/StringTools/Test/Upper.cpp b/StringTools/Test/Upper.cpp index cbefee7..1e7684b 100644 --- a/StringTools/Test/Upper.cpp +++ b/StringTools/Test/Upper.cpp @@ -183,17 +183,43 @@ namespace _StringTools Assert::AreEqual("ÖÓÒÔ", out.c_str()); } + // Tests that lowering already lowered umlautes returns itself + TEST_METHOD(Umlautes_already_upper_i) + { + // Setup + const std::string in = "ÍÌÎ"; + + // Exercise + const std::string out = StringTools::Upper(in); + + // Verify + Assert::AreEqual("ÍÌÎ", out.c_str()); + } + + // Tests that lowering uppercase umlautes returns the lowered umlautes + TEST_METHOD(Umlautes_upper_i) + { + // Setup + const std::string in = "íìî"; + + // Exercise + const std::string out = StringTools::Upper(in); + + // Verify + Assert::AreEqual("ÍÌÎ", out.c_str()); + } + // Tests that uppering a string of uppercase, lowercase letters and symbols returns the lowercase version, even with umlauts TEST_METHOD(Mixed_with_umlautes) { // Setup - const std::string in = "Ügh, Àrä Yóü Seriöûs?! DÒN'T DÔ THÄT!!!"; + const std::string in = "Ügh, Àrä Yóü Serîöûs?! DÒN'T DÔ THÄT!!!"; // Exercise const std::string out = StringTools::Upper(in); // Verify - Assert::AreEqual("ÜGH, ÀRÄ YÓÜ SERIÖÛS?! DÒN'T DÔ THÄT!!!", out.c_str()); + Assert::AreEqual("ÜGH, ÀRÄ YÓÜ SERÎÖÛS?! DÒN'T DÔ THÄT!!!", out.c_str()); return; } }; -- cgit v1.2.3