[PATCH v1 1/2] lib/tests: string_helpers: Decouple unescape and escape cases

From: Andy Shevchenko

Date: Mon Apr 06 2026 - 15:34:58 EST


Currently the escape and unescape test cases go in one step.
Decouple them for the better granularity and understanding test
coverage in the results.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
---
lib/tests/string_helpers_kunit.c | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/lib/tests/string_helpers_kunit.c b/lib/tests/string_helpers_kunit.c
index c853046183d2..cd08e79a857d 100644
--- a/lib/tests/string_helpers_kunit.c
+++ b/lib/tests/string_helpers_kunit.c
@@ -601,6 +601,11 @@ static void test_unescape(struct kunit *test)
test_string_unescape(test, "unescape", i, false);
test_string_unescape(test, "unescape inplace",
get_random_u32_below(UNESCAPE_ALL_MASK + 1), true);
+}
+
+static void test_escape(struct kunit *test)
+{
+ unsigned int i;

/* Without dictionary */
for (i = 0; i < ESCAPE_ALL_MASK + 1; i++)
@@ -615,6 +620,7 @@ static struct kunit_case string_helpers_test_cases[] = {
KUNIT_CASE(test_get_size),
KUNIT_CASE(test_upper_lower),
KUNIT_CASE(test_unescape),
+ KUNIT_CASE(test_escape),
{}
};

--
2.50.1