summaryrefslogtreecommitdiffstats
path: root/src/test/test-string-util.c
diff options
context:
space:
mode:
authorMike Yuan <me@yhndnzj.com>2023-08-26 11:50:24 +0200
committerMike Yuan <me@yhndnzj.com>2023-09-02 16:59:15 +0200
commit00614746e9d6bdd5d8960f81f8c6418d0434f715 (patch)
tree2a2e9b9b9fb225f62e8d6a08566e903f11e252f7 /src/test/test-string-util.c
parentformat-table: use format_timestamp_relative_monotonic (diff)
downloadsystemd-00614746e9d6bdd5d8960f81f8c6418d0434f715.tar.xz
systemd-00614746e9d6bdd5d8960f81f8c6418d0434f715.zip
string-util: introduce strrepa
Diffstat (limited to '')
-rw-r--r--src/test/test-string-util.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/test/test-string-util.c b/src/test/test-string-util.c
index b5f0008d76..a8fd45df73 100644
--- a/src/test/test-string-util.c
+++ b/src/test/test-string-util.c
@@ -260,6 +260,8 @@ TEST(strextend_with_separator) {
TEST(strrep) {
_cleanup_free_ char *one = NULL, *three = NULL, *zero = NULL;
+ char *onea, *threea;
+
one = strrep("waldo", 1);
three = strrep("waldo", 3);
zero = strrep("waldo", 0);
@@ -267,6 +269,12 @@ TEST(strrep) {
assert_se(streq(one, "waldo"));
assert_se(streq(three, "waldowaldowaldo"));
assert_se(streq(zero, ""));
+
+ onea = strrepa("waldo", 1);
+ threea = strrepa("waldo", 3);
+
+ assert_se(streq(onea, "waldo"));
+ assert_se(streq(threea, "waldowaldowaldo"));
}
TEST(string_has_cc) {