]> granicus.if.org Git - llvm/commitdiff
[Support] Add unit test for printLowerCase
authorFrancis Visoiu Mistrih <francisvm@yahoo.com>
Tue, 28 Nov 2017 16:11:56 +0000 (16:11 +0000)
committerFrancis Visoiu Mistrih <francisvm@yahoo.com>
Tue, 28 Nov 2017 16:11:56 +0000 (16:11 +0000)
Add test case for the function added in r319171.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319177 91177308-0d34-0410-b5e6-96231b3b80d8

unittests/ADT/StringExtrasTest.cpp

index 234a40d26cfd1290d22ed4f43928c8ccad0c2813..7bcdaf62fe5a8d414268063606e209bbb215bcfb 100644 (file)
@@ -8,6 +8,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "llvm/ADT/StringExtras.h"
+#include "llvm/Support/raw_ostream.h"
 #include "gtest/gtest.h"
 
 using namespace llvm;
@@ -84,3 +85,10 @@ TEST(StringExtrasTest, to_float) {
   EXPECT_FALSE(to_float("7.4 foo", F));
   EXPECT_FLOAT_EQ(4.7f, F); // F should be unchanged
 }
+
+TEST(StringExtrasTest, printLowerCase) {
+  std::string str;
+  raw_string_ostream OS(str);
+  printLowerCase("ABCdefg01234.,&!~`'}\"", OS);
+  EXPECT_EQ("abcdefg01234.,&!~`'}\"", OS.str());
+}