diff options
author | James Booth <boothj5@gmail.com> | 2013-07-21 23:33:32 +0100 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2013-07-21 23:33:32 +0100 |
commit | c5c596f70aa085a03d71868bbdebe9ef326b3b10 (patch) | |
tree | c8b9115240f731116e602ee6871bdcd95efb5c2d /tests | |
parent | 7906bd6a9dc76a98d9bd63c4ea30801f0f91a485 (diff) | |
parent | cbe3c41abedf5ffa48761009af4ab426eb850a38 (diff) | |
download | profani-tty-c5c596f70aa085a03d71868bbdebe9ef326b3b10.tar.gz |
Merge branch 'master' into nextdev
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_parser.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/test_parser.c b/tests/test_parser.c index e442baee..6df5eb1d 100644 --- a/tests/test_parser.c +++ b/tests/test_parser.c @@ -281,6 +281,18 @@ parse_cmd_freetext_with_many_quoted_and_many_spaces(void) } void +parse_cmd_with_quoted_freetext(void) +{ + char *inp = "/cmd arg1 here is \"some\" quoted freetext"; + gchar **result = parse_args_with_freetext(inp, 1, 2); + + assert_int_equals(2, g_strv_length(result)); + assert_string_equals("arg1", result[0]); + assert_string_equals("here is \"some\" quoted freetext", result[1]); + g_strfreev(result); +} + +void count_one_token(void) { char *inp = "one"; @@ -425,6 +437,7 @@ register_parser_tests(void) TEST(parse_cmd_freetext_with_quoted_and_space); TEST(parse_cmd_freetext_with_quoted_and_many_spaces); TEST(parse_cmd_freetext_with_many_quoted_and_many_spaces); + TEST(parse_cmd_with_quoted_freetext); TEST(count_one_token); TEST(count_one_token_quoted_no_whitespace); TEST(count_one_token_quoted_with_whitespace); |