#include "net/base/net_string_util.h"
#include <string>
#include "base/strings/utf_string_conversions.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace net {
TEST(NetStringUtilTest, ToUpperEmpty) {
std::u16string in;
std::u16string out;
std::u16string expected;
ASSERT_TRUE(ToUpper(in, &out));
ASSERT_EQ(expected, out);
}
TEST(NetStringUtilTest, ToUpperSingleChar) {
std::u16string in(u"a");
std::u16string out;
std::u16string expected(u"A");
ASSERT_TRUE(ToUpper(in, &out));
ASSERT_EQ(expected, out);
}
TEST(NetStringUtilTest, ToUpperSimple) {
std::u16string in(u"hello world");
std::u16string out;
std::u16string expected(u"HELLO WORLD");
ASSERT_TRUE(ToUpper(in, &out));
ASSERT_EQ(expected, out);
}
TEST(NetStringUtilTest, ToUpperAlreadyUpper) {
std::u16string in(u"HELLO WORLD");
std::u16string out;
std::u16string expected(u"HELLO WORLD");
ASSERT_TRUE(ToUpper(in, &out));
ASSERT_EQ(expected, out);
}
}