summaryrefslogtreecommitdiff
path: root/src/utils/stringutils_unittest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/stringutils_unittest.cc')
-rw-r--r--src/utils/stringutils_unittest.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/utils/stringutils_unittest.cc b/src/utils/stringutils_unittest.cc
index 75f4f2f35..8f28f5c10 100644
--- a/src/utils/stringutils_unittest.cc
+++ b/src/utils/stringutils_unittest.cc
@@ -551,3 +551,16 @@ TEST(stringuntils, decodeLinkText)
str = decodeLinkText(str);
EXPECT_EQ(str, "test|line");
}
+
+TEST(stringuntils, isDigit)
+{
+ std::string str;
+
+ EXPECT_FALSE(isDigit(""));
+ EXPECT_TRUE(isDigit("1"));
+ EXPECT_TRUE(isDigit("123"));
+ EXPECT_FALSE(isDigit("+123"));
+ EXPECT_FALSE(isDigit("-123"));
+ EXPECT_FALSE(isDigit("1.23"));
+ EXPECT_FALSE(isDigit("12-34"));
+}