diff options
Diffstat (limited to 'src/test/test-env-util.c')
-rw-r--r-- | src/test/test-env-util.c | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/src/test/test-env-util.c b/src/test/test-env-util.c index b1e69d4a5a..e645d4968e 100644 --- a/src/test/test-env-util.c +++ b/src/test/test-env-util.c @@ -1,23 +1,4 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -/*** - This file is part of systemd. - - Copyright 2010 Lennart Poettering - Copyright 2016 Zbigniew Jędrzejewski-Szmek - - systemd is free software; you can redistribute it and/or modify it - under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 2.1 of the License, or - (at your option) any later version. - - systemd is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with systemd; If not, see <http://www.gnu.org/licenses/>. -***/ #include <string.h> @@ -277,8 +258,9 @@ static void test_env_clean(void) { assert_se(streq(e[1], "X=")); assert_se(streq(e[2], "F=F")); assert_se(streq(e[3], "abcd=äöüß")); - assert_se(streq(e[4], "another=final one")); - assert_se(e[5] == NULL); + assert_se(streq(e[4], "xyz=xyz\n")); + assert_se(streq(e[5], "another=final one")); + assert_se(e[6] == NULL); } static void test_env_name_is_valid(void) { @@ -297,6 +279,8 @@ static void test_env_value_is_valid(void) { assert_se(env_value_is_valid("")); assert_se(env_value_is_valid("głąb kapuściany")); assert_se(env_value_is_valid("printf \"\\x1b]0;<mock-chroot>\\x07<mock-chroot>\"")); + assert_se(env_value_is_valid("tab\tcharacter")); + assert_se(env_value_is_valid("new\nline")); } static void test_env_assignment_is_valid(void) { @@ -304,6 +288,8 @@ static void test_env_assignment_is_valid(void) { assert_se(env_assignment_is_valid("b=głąb kapuściany")); assert_se(env_assignment_is_valid("c=\\007\\009\\011")); assert_se(env_assignment_is_valid("e=printf \"\\x1b]0;<mock-chroot>\\x07<mock-chroot>\"")); + assert_se(env_assignment_is_valid("f=tab\tcharacter")); + assert_se(env_assignment_is_valid("g=new\nline")); assert_se(!env_assignment_is_valid("=")); assert_se(!env_assignment_is_valid("a b=")); |