mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-10-26 08:55:18 +03:00
test-escape: Add tests for escaping bogus UTF-8 sequences
(cherry picked from commit582843ee37
) (cherry picked from commitc4e7cf2bd7
) (cherry picked from commitdec5e2e7b5
)
This commit is contained in:
parent
dfa043ae1f
commit
11ecf66646
@ -196,6 +196,10 @@ TEST(shell_maybe_quote) {
|
|||||||
|
|
||||||
test_shell_maybe_quote_one("głąb\002\003rząd", 0, "\"głąb\\002\\003rząd\"");
|
test_shell_maybe_quote_one("głąb\002\003rząd", 0, "\"głąb\\002\\003rząd\"");
|
||||||
test_shell_maybe_quote_one("głąb\002\003rząd", SHELL_ESCAPE_POSIX, "$'głąb\\002\\003rząd'");
|
test_shell_maybe_quote_one("głąb\002\003rząd", SHELL_ESCAPE_POSIX, "$'głąb\\002\\003rząd'");
|
||||||
|
|
||||||
|
/* Bogus UTF-8 strings */
|
||||||
|
test_shell_maybe_quote_one("\250\350", 0, "\"\\250\\350\"");
|
||||||
|
test_shell_maybe_quote_one("\250\350", SHELL_ESCAPE_POSIX, "$'\\250\\350'");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void test_quote_command_line_one(char **argv, const char *expected) {
|
static void test_quote_command_line_one(char **argv, const char *expected) {
|
||||||
|
Loading…
Reference in New Issue
Block a user