/* SPDX-License-Identifier: LGPL-2.1+ */
-/***
- This file is part of systemd.
-
- Copyright 2015 Lennart Poettering
-***/
#include "alloc-util.h"
-//#include "locale-util.h"
+#include "locale-util.h"
#include "macro.h"
#include "string-util.h"
#include "strv.h"
+#include "utf8.h"
static void test_string_erase(void) {
char *x;
assert_se(!endswith_no_case("foobar", "FOOBARFOOFOO"));
}
-#if 0 /// UNNEEDED by elogind
static void test_delete_chars(void) {
char *s, input[] = " hello, waldo. abc";
assert_se(streq(s, "hello,waldo.abc"));
assert_se(s == input);
}
-#endif // 0
static void test_delete_trailing_chars(void) {
assert_se(streq(delete_trailing_chars(s4, "/"), ""));
}
-#if 0 /// UNNEEDED by elogind
static void test_skip_leading_chars(void) {
char input1[] = " \n \r k \n \r ",
input2[] = "kkkkthiskkkiskkkaktestkkk",
assert_se(streq(skip_leading_chars(input3, WHITESPACE), "abcdef"));
assert_se(streq(skip_leading_chars(input3, "bcaef"), "def"));
}
-#endif // 0
static void test_in_charset(void) {
assert_se(in_charset("dddaaabbbcccc", "abcd"));
test_foreach_word_quoted();
test_endswith();
test_endswith_no_case();
-#if 0 /// UNNEEDED by elogind
test_delete_chars();
-#endif // 0
test_delete_trailing_chars();
test_delete_trailing_slashes();
-#if 0 /// UNNEEDED by elogind
test_skip_leading_chars();
-#endif // 0
test_in_charset();
test_split_pair();
test_first_word();