Skip to content

Commit 7179a6f

Browse files
[tool] add IsStringNullOrEmpty() test
1 parent 159a340 commit 7179a6f

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/framework/NetString.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ namespace System
222222

223223
static bool IsNullOrEmpty(const String &s)
224224
{
225-
retunr (s.Length()==0);
225+
return (s.Length()==0);
226226
}
227227
};
228228

src/unittests/String_Test.cxx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,3 +136,9 @@ TEST(StringTest, Trim)
136136
EXPECT_EQ(String("Hello"),String("Hello").TrimEnd());
137137
EXPECT_EQ(String(" Hello"),String(" Hello ").TrimEnd());
138138
}
139+
140+
TEST(StringTest, NullOrEmpty)
141+
{
142+
EXPECT_FALSE(String::IsStringNullOrEmpty(String("Hello")));
143+
EXPECT_TRUE(String::IsStringNullOrEmpty(String("")));
144+
}

0 commit comments

Comments
 (0)