aboutsummaryrefslogtreecommitdiff
path: root/tests/unit_tests/epee_utils.cpp
diff options
context:
space:
mode:
authortobtoht <tob@featherwallet.org>2024-08-14 16:13:35 +0200
committertobtoht <tob@featherwallet.org>2024-08-14 16:57:49 +0200
commitc7d4bf491e9f9fc1f5c5cd08759ef6020a025170 (patch)
tree4e58dd56a1064be61a70a5406e6d8f3c070555c4 /tests/unit_tests/epee_utils.cpp
parentc6d17a0b3938270b997f199e19ab47d4c2b41a83 (diff)
downloadmonzero-core-c7d4bf491e9f9fc1f5c5cd08759ef6020a025170.tar.gz
monzero-core-c7d4bf491e9f9fc1f5c5cd08759ef6020a025170.tar.xz
monzero-core-c7d4bf491e9f9fc1f5c5cd08759ef6020a025170.zip
epee: string_tools: remove dot from get_extension
Fixes a regression introduced in #9254. Previously it did not include the dot.
Diffstat (limited to 'tests/unit_tests/epee_utils.cpp')
-rw-r--r--tests/unit_tests/epee_utils.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/unit_tests/epee_utils.cpp b/tests/unit_tests/epee_utils.cpp
index d30bd3bd6..583b3642f 100644
--- a/tests/unit_tests/epee_utils.cpp
+++ b/tests/unit_tests/epee_utils.cpp
@@ -1427,6 +1427,14 @@ TEST(StringTools, GetIpInt32)
EXPECT_EQ(htonl(0xff0aff00), ip);
}
+TEST(StringTools, GetExtension)
+{
+ EXPECT_EQ(std::string{}, epee::string_tools::get_extension(""));
+ EXPECT_EQ(std::string{}, epee::string_tools::get_extension("."));
+ EXPECT_EQ(std::string{"keys"}, epee::string_tools::get_extension("wallet.keys"));
+ EXPECT_EQ(std::string{"3"}, epee::string_tools::get_extension("1.2.3"));
+}
+
TEST(NetUtils, IPv4NetworkAddress)
{
static_assert(epee::net_utils::ipv4_network_address::get_type_id() == epee::net_utils::address_type::ipv4, "bad ipv4 type id");