aboutsummaryrefslogtreecommitdiff
path: root/libs/uibase/tests/test_strings.cpp
diff options
context:
space:
mode:
authorSulfurNitride <SulfurNitride@users.noreply.github.com>2026-02-11 02:37:39 -0600
committerSulfurNitride <SulfurNitride@users.noreply.github.com>2026-02-11 02:37:39 -0600
commit7ee008e150bc5bcf76082d726f719ee0fdfda982 (patch)
tree27fb39be241fdb5ac2734c574de678977d1856d0 /libs/uibase/tests/test_strings.cpp
Fluorine Manager: full Linux port of Mod Organizer 2
Complete native Linux port with FUSE-based virtual filesystem, Proton/umu-run integration, and Flatpak packaging. Key features: - FUSE VFS replacing Windows USVFS (in-process + standalone helper for Flatpak) - Proton/GE-Proton/umu-run launcher with env var forwarding - Flatpak support (sandbox-aware VFS, NXM handler, umu-run) - Wine prefix management UI - Case-insensitive path resolution for Linux filesystems - QSettings-safe INI handling (avoids Bethesda INI corruption) - Portable instance support with auto-generated launcher scripts Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'libs/uibase/tests/test_strings.cpp')
-rw-r--r--libs/uibase/tests/test_strings.cpp47
1 files changed, 47 insertions, 0 deletions
diff --git a/libs/uibase/tests/test_strings.cpp b/libs/uibase/tests/test_strings.cpp
new file mode 100644
index 0000000..0185f83
--- /dev/null
+++ b/libs/uibase/tests/test_strings.cpp
@@ -0,0 +1,47 @@
+#pragma warning(push)
+#pragma warning(disable : 4668)
+#include <gtest/gtest.h>
+#pragma warning(pop)
+
+#include <QCoreApplication>
+
+#include <uibase/strings.h>
+
+#include <format>
+
+using namespace MOBase;
+
+TEST(StringsTest, IEquals)
+{
+ ASSERT_TRUE(iequals("hello world", "HelLO WOrlD"));
+}
+
+TEST(StringsTest, IReplaceAll)
+{
+ auto ireplace_all = [](std::string_view input, std::string_view search,
+ std::string_view replace) {
+ std::string s_input{input};
+ MOBase::ireplace_all(s_input, search, replace);
+ return s_input;
+ };
+
+ ASSERT_EQ("", ireplace_all("", "world", "MO2"));
+ ASSERT_EQ("Hello World!", ireplace_all("Hello World!", "Test", "MO2"));
+ ASSERT_EQ("replace a stuff with a stuff a",
+ ireplace_all("replace some stuff with some stuff some", "some", "a"));
+ ASSERT_EQ("replace a stuff with a stuff som",
+ ireplace_all("replace some stuff with some stuff som", "some", "a"));
+ ASSERT_EQ("1YYY3YYY2", ireplace_all("1aBc3AbC2", "abC", "YYY"));
+
+ ASSERT_EQ(
+ "data path: C:/Users/USERNAME/AppData/Local/ModOrganizer/Starfield",
+ ireplace_all("data path: C:/Users/lords/AppData/Local/ModOrganizer/Starfield",
+ "/lords", "/USERNAME"));
+}
+
+// this is more a tests of the tests
+TEST(StringsTest, Translation)
+{
+ ASSERT_EQ("Traduction en Français",
+ QCoreApplication::translate("uibase-tests", "Translate to French"));
+}