Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: test/plugin/UtilTest.cpp

Issue 29332775: Issue #1234 - Remove 'CString' From 'ToLowerString()' (Closed)
Patch Set: Created Dec. 15, 2015, 9:10 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« src/plugin/PluginUtil.cpp ('K') | « src/plugin/PluginUtil.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/plugin/UtilTest.cpp
===================================================================
--- a/test/plugin/UtilTest.cpp
+++ b/test/plugin/UtilTest.cpp
@@ -71,3 +71,23 @@
{
ASSERT_FALSE(BeginsWithForTesting(L"foo", L"barfoo"));
}
+
+TEST(ToLowerString, Empty)
+{
+ ASSERT_EQ(std::wstring(), ToLowerString(L""));
sergei 2015/12/16 10:32:45 It's still not clear why we are using ASSERT in a
Eric 2015/12/16 13:53:27 Because I prefer ASSERT. And as I've said before,
+}
+
+TEST(ToLowerString, NotEmpty)
+{
+ ASSERT_EQ(std::wstring(L"foo"), ToLowerString(L"Foo"));
sergei 2015/12/16 10:32:45 Is it necessary to explicitly construct std::wstri
Eric 2015/12/16 13:53:27 I checked. No. They were in there because I've ha
+}
+
+TEST(ToLowerString, NullWithExtra)
+{
+ ASSERT_EQ(std::wstring(L"\0BAR"), ToLowerString(L"\0BAR"));
sergei 2015/12/16 10:32:45 I think this test and below are incorrect. Mainly
Eric 2015/12/16 13:53:27 Yep. Fixed that. I keep forgetting that constructi
+}
+
+TEST(ToLowerString, InternalNull)
+{
+ ASSERT_EQ(std::wstring(L"foo\0BAR"), ToLowerString(L"Foo\0BAR"));
+}
« src/plugin/PluginUtil.cpp ('K') | « src/plugin/PluginUtil.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld