Merge branch 'master' into readline
This commit is contained in:
@@ -587,3 +587,47 @@ void utf8_display_len_all_wide(void **state)
|
||||
assert_int_equal(8, result);
|
||||
}
|
||||
|
||||
void strip_quotes_does_nothing_when_no_quoted(void **state)
|
||||
{
|
||||
char *input = "/cmd test string";
|
||||
|
||||
char *result = strip_arg_quotes(input);
|
||||
|
||||
assert_string_equal("/cmd test string", result);
|
||||
|
||||
free(result);
|
||||
}
|
||||
|
||||
void strip_quotes_strips_first(void **state)
|
||||
{
|
||||
char *input = "/cmd \"test string";
|
||||
|
||||
char *result = strip_arg_quotes(input);
|
||||
|
||||
assert_string_equal("/cmd test string", result);
|
||||
|
||||
free(result);
|
||||
}
|
||||
|
||||
void strip_quotes_strips_last(void **state)
|
||||
{
|
||||
char *input = "/cmd test string\"";
|
||||
|
||||
char *result = strip_arg_quotes(input);
|
||||
|
||||
assert_string_equal("/cmd test string", result);
|
||||
|
||||
free(result);
|
||||
}
|
||||
|
||||
void strip_quotes_strips_both(void **state)
|
||||
{
|
||||
char *input = "/cmd \"test string\"";
|
||||
|
||||
char *result = strip_arg_quotes(input);
|
||||
|
||||
assert_string_equal("/cmd test string", result);
|
||||
|
||||
free(result);
|
||||
}
|
||||
|
||||
|
||||
@@ -51,4 +51,8 @@ void utf8_display_len_1_non_wide(void **state);
|
||||
void utf8_display_len_1_wide(void **state);
|
||||
void utf8_display_len_non_wide(void **state);
|
||||
void utf8_display_len_wide(void **state);
|
||||
void utf8_display_len_all_wide(void **state);
|
||||
void utf8_display_len_all_wide(void **state);
|
||||
void strip_quotes_does_nothing_when_no_quoted(void **state);
|
||||
void strip_quotes_strips_first(void **state);
|
||||
void strip_quotes_strips_last(void **state);
|
||||
void strip_quotes_strips_both(void **state);
|
||||
|
||||
@@ -90,6 +90,10 @@ int main(int argc, char* argv[]) {
|
||||
unit_test(utf8_display_len_non_wide),
|
||||
unit_test(utf8_display_len_wide),
|
||||
unit_test(utf8_display_len_all_wide),
|
||||
unit_test(strip_quotes_does_nothing_when_no_quoted),
|
||||
unit_test(strip_quotes_strips_first),
|
||||
unit_test(strip_quotes_strips_last),
|
||||
unit_test(strip_quotes_strips_both),
|
||||
|
||||
unit_test(clear_empty),
|
||||
unit_test(reset_after_create),
|
||||
|
||||
Reference in New Issue
Block a user