aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authortobtoht <tob@featherwallet.org>2024-08-14 19:45:55 +0200
committertobtoht <tob@featherwallet.org>2024-08-14 19:50:06 +0200
commit7cb69fa6bc668e6a4b485f7e192007d5ac84a44c (patch)
treed301e2f9fd084d7b870aaacb2072fc5227ddbc3f /tests
parentc7d4bf491e9f9fc1f5c5cd08759ef6020a025170 (diff)
downloadmonzero-core-7cb69fa6bc668e6a4b485f7e192007d5ac84a44c.tar.gz
monzero-core-7cb69fa6bc668e6a4b485f7e192007d5ac84a44c.tar.xz
monzero-core-7cb69fa6bc668e6a4b485f7e192007d5ac84a44c.zip
epee: string_tools: keep full path in cut_off_extension
Diffstat (limited to 'tests')
-rw-r--r--tests/unit_tests/epee_utils.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/unit_tests/epee_utils.cpp b/tests/unit_tests/epee_utils.cpp
index 583b3642f..cc32f8bf3 100644
--- a/tests/unit_tests/epee_utils.cpp
+++ b/tests/unit_tests/epee_utils.cpp
@@ -1435,6 +1435,13 @@ TEST(StringTools, GetExtension)
EXPECT_EQ(std::string{"3"}, epee::string_tools::get_extension("1.2.3"));
}
+TEST(StringTools, CutOffExtension)
+{
+ EXPECT_EQ(std::string{}, epee::string_tools::cut_off_extension(""));
+ EXPECT_EQ(std::string{"/home/user/Monero/wallets/wallet"}, epee::string_tools::cut_off_extension("/home/user/Monero/wallets/wallet"));
+ EXPECT_EQ(std::string{"/home/user/Monero/wallets/wallet"}, epee::string_tools::cut_off_extension("/home/user/Monero/wallets/wallet.keys"));
+}
+
TEST(NetUtils, IPv4NetworkAddress)
{
static_assert(epee::net_utils::ipv4_network_address::get_type_id() == epee::net_utils::address_type::ipv4, "bad ipv4 type id");