revert: restore pre-upstream-merge baseline (tree of 3b673150b)
All checks were successful
CI Code / Check spelling (pull_request) Successful in 18s
CI Code / Check coding style (pull_request) Successful in 30s
CI Code / Linux (ubuntu) (pull_request) Successful in 4m51s
CI Code / Linux (debian) (pull_request) Successful in 6m59s
CI Code / Linux (arch) (pull_request) Successful in 10m12s
CI Code / Code Coverage (pull_request) Successful in 6m44s
All checks were successful
CI Code / Check spelling (pull_request) Successful in 18s
CI Code / Check coding style (pull_request) Successful in 30s
CI Code / Linux (ubuntu) (pull_request) Successful in 4m51s
CI Code / Linux (debian) (pull_request) Successful in 6m59s
CI Code / Linux (arch) (pull_request) Successful in 10m12s
CI Code / Code Coverage (pull_request) Successful in 6m44s
Roll the tree back to the pre-merge tip3b673150b, undoing the upstream sync merge72f4f186d(303 files) and the 13 post-merge commits layered on top of it. Purpose: restore the last pre-sync baseline so the reported OMEMO/OTR encryption regressions can be reproduced against a known-good state and the upstream sync ruled in or out as the cause. Nothing is dropped from history; the merge and every post-merge commit remain reachable and can be cherry-picked back selectively. Baseline:3b673150bchore(chatlog): disable background message file logging (stage 1) Undoes merge:72f4f186dmerge: sync upstream profanity-im/profanity
This commit is contained in:
@@ -1,11 +1,3 @@
|
||||
/*
|
||||
* stub_http_upload.c
|
||||
*
|
||||
* Copyright (C) 2017 James Booth <boothj5@gmail.com>
|
||||
* Copyright (C) 2020 - 2026 Michael Vetter <jubalh@iodoru.org>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
#ifndef TOOLS_HTTP_UPLOAD_H
|
||||
#define TOOLS_HTTP_UPLOAD_H
|
||||
|
||||
|
||||
@@ -1,375 +0,0 @@
|
||||
#include <glib.h>
|
||||
#include "prof_cmocka.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "xmpp/contact.h"
|
||||
#include "tools/autocomplete.h"
|
||||
|
||||
void
|
||||
autocomplete_complete__returns__null_when_empty(void** state)
|
||||
{
|
||||
Autocomplete ac = autocomplete_new();
|
||||
char* result = autocomplete_complete(ac, "test", TRUE, FALSE);
|
||||
assert_null(result);
|
||||
autocomplete_free(ac);
|
||||
free(result);
|
||||
}
|
||||
|
||||
void
|
||||
autocomplete_reset__updates__after_create(void** state)
|
||||
{
|
||||
Autocomplete ac = autocomplete_new();
|
||||
autocomplete_reset(ac);
|
||||
autocomplete_free(ac);
|
||||
}
|
||||
|
||||
void
|
||||
autocomplete_complete__returns__null_after_create(void** state)
|
||||
{
|
||||
Autocomplete ac = autocomplete_new();
|
||||
char* result = autocomplete_complete(ac, "hello", TRUE, FALSE);
|
||||
assert_null(result);
|
||||
autocomplete_free(ac);
|
||||
free(result);
|
||||
}
|
||||
|
||||
void
|
||||
autocomplete_create_list__returns__null_after_create(void** state)
|
||||
{
|
||||
Autocomplete ac = autocomplete_new();
|
||||
GList* result = autocomplete_create_list(ac);
|
||||
|
||||
assert_null(result);
|
||||
|
||||
autocomplete_free(ac);
|
||||
g_list_free_full(result, free);
|
||||
}
|
||||
|
||||
void
|
||||
autocomplete_add__updates__one_and_complete(void** state)
|
||||
{
|
||||
Autocomplete ac = autocomplete_new();
|
||||
autocomplete_add(ac, "Hello");
|
||||
char* result = autocomplete_complete(ac, "Hel", TRUE, FALSE);
|
||||
|
||||
assert_string_equal("Hello", result);
|
||||
|
||||
autocomplete_free(ac);
|
||||
free(result);
|
||||
}
|
||||
|
||||
void
|
||||
autocomplete_complete__returns__first_of_two(void** state)
|
||||
{
|
||||
Autocomplete ac = autocomplete_new();
|
||||
autocomplete_add(ac, "Hello");
|
||||
autocomplete_add(ac, "Help");
|
||||
char* result = autocomplete_complete(ac, "Hel", TRUE, FALSE);
|
||||
|
||||
assert_string_equal("Hello", result);
|
||||
|
||||
autocomplete_free(ac);
|
||||
free(result);
|
||||
}
|
||||
|
||||
void
|
||||
autocomplete_complete__returns__second_of_two(void** state)
|
||||
{
|
||||
Autocomplete ac = autocomplete_new();
|
||||
autocomplete_add(ac, "Hello");
|
||||
autocomplete_add(ac, "Help");
|
||||
char* result1 = autocomplete_complete(ac, "Hel", TRUE, FALSE);
|
||||
char* result2 = autocomplete_complete(ac, result1, TRUE, FALSE);
|
||||
|
||||
assert_string_equal("Help", result2);
|
||||
|
||||
autocomplete_free(ac);
|
||||
free(result1);
|
||||
free(result2);
|
||||
}
|
||||
|
||||
void
|
||||
autocomplete_add__updates__two_elements(void** state)
|
||||
{
|
||||
Autocomplete ac = autocomplete_new();
|
||||
autocomplete_add(ac, "Hello");
|
||||
autocomplete_add(ac, "Help");
|
||||
GList* result = autocomplete_create_list(ac);
|
||||
|
||||
assert_int_equal(2, g_list_length(result));
|
||||
|
||||
autocomplete_free(ac);
|
||||
g_list_free_full(result, free);
|
||||
}
|
||||
|
||||
void
|
||||
autocomplete_add__updates__only_once_for_same_value(void** state)
|
||||
{
|
||||
Autocomplete ac = autocomplete_new();
|
||||
autocomplete_add(ac, "Hello");
|
||||
autocomplete_add(ac, "Hello");
|
||||
GList* result = autocomplete_create_list(ac);
|
||||
|
||||
assert_int_equal(1, g_list_length(result));
|
||||
|
||||
autocomplete_free(ac);
|
||||
g_list_free_full(result, free);
|
||||
}
|
||||
|
||||
void
|
||||
autocomplete_add__updates__existing_value(void** state)
|
||||
{
|
||||
Autocomplete ac = autocomplete_new();
|
||||
autocomplete_add(ac, "Hello");
|
||||
autocomplete_add(ac, "Hello");
|
||||
GList* result = autocomplete_create_list(ac);
|
||||
|
||||
GList* first = g_list_nth(result, 0);
|
||||
|
||||
char* str = first->data;
|
||||
|
||||
assert_string_equal("Hello", str);
|
||||
|
||||
autocomplete_free(ac);
|
||||
g_list_free_full(result, free);
|
||||
}
|
||||
|
||||
void
|
||||
autocomplete_complete__returns__accented_with_accented(void** state)
|
||||
{
|
||||
Autocomplete ac = autocomplete_new();
|
||||
autocomplete_add(ac, "èâîô");
|
||||
|
||||
char* result = autocomplete_complete(ac, "èâ", TRUE, FALSE);
|
||||
|
||||
assert_string_equal("èâîô", result);
|
||||
|
||||
autocomplete_free(ac);
|
||||
free(result);
|
||||
}
|
||||
|
||||
void
|
||||
autocomplete_complete__returns__accented_with_base(void** state)
|
||||
{
|
||||
Autocomplete ac = autocomplete_new();
|
||||
autocomplete_add(ac, "èâîô");
|
||||
|
||||
char* result = autocomplete_complete(ac, "ea", TRUE, FALSE);
|
||||
|
||||
assert_string_equal("èâîô", result);
|
||||
|
||||
autocomplete_free(ac);
|
||||
free(result);
|
||||
}
|
||||
|
||||
void
|
||||
autocomplete_complete__returns__both_with_accented(void** state)
|
||||
{
|
||||
Autocomplete ac = autocomplete_new();
|
||||
autocomplete_add(ac, "eaooooo");
|
||||
autocomplete_add(ac, "èâîô");
|
||||
|
||||
char* result1 = autocomplete_complete(ac, "èâ", TRUE, FALSE);
|
||||
char* result2 = autocomplete_complete(ac, result1, TRUE, FALSE);
|
||||
|
||||
assert_string_equal("èâîô", result2);
|
||||
|
||||
autocomplete_free(ac);
|
||||
free(result1);
|
||||
free(result2);
|
||||
}
|
||||
|
||||
void
|
||||
autocomplete_complete__returns__both_with_base(void** state)
|
||||
{
|
||||
Autocomplete ac = autocomplete_new();
|
||||
autocomplete_add(ac, "eaooooo");
|
||||
autocomplete_add(ac, "èâîô");
|
||||
|
||||
char* result1 = autocomplete_complete(ac, "ea", TRUE, FALSE);
|
||||
char* result2 = autocomplete_complete(ac, result1, TRUE, FALSE);
|
||||
|
||||
assert_string_equal("èâîô", result2);
|
||||
|
||||
autocomplete_free(ac);
|
||||
|
||||
free(result1);
|
||||
free(result2);
|
||||
}
|
||||
|
||||
void
|
||||
autocomplete_complete__is__case_insensitive(void** state)
|
||||
{
|
||||
Autocomplete ac = autocomplete_new();
|
||||
autocomplete_add(ac, "MyBuddy");
|
||||
|
||||
char* result = autocomplete_complete(ac, "myb", TRUE, FALSE);
|
||||
|
||||
assert_string_equal("MyBuddy", result);
|
||||
|
||||
autocomplete_free(ac);
|
||||
free(result);
|
||||
}
|
||||
|
||||
void
|
||||
autocomplete_complete__returns__previous(void** state)
|
||||
{
|
||||
Autocomplete ac = autocomplete_new();
|
||||
autocomplete_add(ac, "MyBuddy1");
|
||||
autocomplete_add(ac, "MyBuddy2");
|
||||
autocomplete_add(ac, "MyBuddy3");
|
||||
|
||||
char* result1 = autocomplete_complete(ac, "myb", TRUE, FALSE);
|
||||
char* result2 = autocomplete_complete(ac, result1, TRUE, FALSE);
|
||||
char* result3 = autocomplete_complete(ac, result2, TRUE, FALSE);
|
||||
char* result4 = autocomplete_complete(ac, result3, TRUE, TRUE);
|
||||
|
||||
assert_string_equal("MyBuddy2", result4);
|
||||
|
||||
autocomplete_free(ac);
|
||||
|
||||
free(result1);
|
||||
free(result2);
|
||||
free(result3);
|
||||
free(result4);
|
||||
}
|
||||
|
||||
void
|
||||
autocomplete_complete__returns__greek_false_match(void** state)
|
||||
{
|
||||
Autocomplete ac = autocomplete_new();
|
||||
// Σωκράτης (Socrates) and Πλάτων (Plato)
|
||||
autocomplete_add(ac, "Σωκράτης");
|
||||
autocomplete_add(ac, "Πλάτων");
|
||||
|
||||
char* result = autocomplete_complete(ac, "Π", TRUE, FALSE);
|
||||
|
||||
assert_string_equal("Πλάτων", result);
|
||||
|
||||
autocomplete_free(ac);
|
||||
free(result);
|
||||
}
|
||||
|
||||
void
|
||||
autocomplete_complete__returns__greek(void** state)
|
||||
{
|
||||
Autocomplete ac = autocomplete_new();
|
||||
autocomplete_add(ac, "Αριστοτέλης");
|
||||
|
||||
char* result = autocomplete_complete(ac, "Αριστ", TRUE, FALSE);
|
||||
|
||||
assert_non_null(result);
|
||||
assert_string_equal("Αριστοτέλης", result);
|
||||
|
||||
autocomplete_free(ac);
|
||||
free(result);
|
||||
}
|
||||
|
||||
void
|
||||
autocomplete_complete__returns__greek_case_insensitive(void** state)
|
||||
{
|
||||
Autocomplete ac = autocomplete_new();
|
||||
autocomplete_add(ac, "Σωκράτης");
|
||||
|
||||
// Case insensitive search for Socrates
|
||||
// σω is the lowercase of Σω
|
||||
char* result = autocomplete_complete(ac, "σω", TRUE, FALSE);
|
||||
|
||||
assert_non_null(result);
|
||||
assert_string_equal("Σωκράτης", result);
|
||||
|
||||
autocomplete_free(ac);
|
||||
free(result);
|
||||
}
|
||||
|
||||
void
|
||||
autocomplete_complete__returns__russian(void** state)
|
||||
{
|
||||
Autocomplete ac = autocomplete_new();
|
||||
autocomplete_add(ac, "Достоевский");
|
||||
autocomplete_add(ac, "Толстой");
|
||||
autocomplete_add(ac, "Пушкин");
|
||||
|
||||
char* result = autocomplete_complete(ac, "дост", TRUE, FALSE);
|
||||
|
||||
assert_non_null(result);
|
||||
assert_string_equal("Достоевский", result);
|
||||
|
||||
autocomplete_free(ac);
|
||||
free(result);
|
||||
}
|
||||
|
||||
void
|
||||
autocomplete_complete__returns__chinese(void** state)
|
||||
{
|
||||
Autocomplete ac = autocomplete_new();
|
||||
autocomplete_add(ac, "孙子");
|
||||
autocomplete_add(ac, "诸葛亮");
|
||||
|
||||
char* result = autocomplete_complete(ac, "孙", TRUE, FALSE);
|
||||
|
||||
assert_non_null(result);
|
||||
assert_string_equal("孙子", result);
|
||||
|
||||
autocomplete_free(ac);
|
||||
free(result);
|
||||
}
|
||||
|
||||
void
|
||||
autocomplete_complete__returns__transliterated(void** state)
|
||||
{
|
||||
Autocomplete ac = autocomplete_new();
|
||||
autocomplete_add(ac, "München");
|
||||
|
||||
// Match 'ü' with 'u'
|
||||
char* result = autocomplete_complete(ac, "mun", TRUE, FALSE);
|
||||
|
||||
assert_non_null(result);
|
||||
assert_string_equal("München", result);
|
||||
|
||||
autocomplete_free(ac);
|
||||
free(result);
|
||||
}
|
||||
|
||||
void
|
||||
autocomplete_complete__returns__regular_ascii(void** state)
|
||||
{
|
||||
Autocomplete ac = autocomplete_new();
|
||||
autocomplete_add(ac, "London");
|
||||
|
||||
char* result = autocomplete_complete(ac, "lon", TRUE, FALSE);
|
||||
|
||||
assert_non_null(result);
|
||||
assert_string_equal("London", result);
|
||||
|
||||
autocomplete_free(ac);
|
||||
free(result);
|
||||
}
|
||||
|
||||
void
|
||||
autocomplete_complete__handles__escaped_spaces(void** state)
|
||||
{
|
||||
Autocomplete ac = autocomplete_new();
|
||||
autocomplete_add(ac, "Thor Odinson");
|
||||
|
||||
char* result = autocomplete_complete(ac, "Thor\\ ", TRUE, FALSE);
|
||||
|
||||
assert_string_equal("\"Thor Odinson\"", result);
|
||||
|
||||
autocomplete_free(ac);
|
||||
free(result);
|
||||
}
|
||||
|
||||
void
|
||||
autocomplete_complete__handles__escaped_quotes(void** state)
|
||||
{
|
||||
Autocomplete ac = autocomplete_new();
|
||||
autocomplete_add(ac, "Thor \"The Thunderer\" Odinson");
|
||||
|
||||
char* result = autocomplete_complete(ac, "Thor \\\"", TRUE, FALSE);
|
||||
|
||||
assert_string_equal("\"Thor \\\"The Thunderer\\\" Odinson\"", result);
|
||||
|
||||
autocomplete_free(ac);
|
||||
free(result);
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
#ifndef TESTS_TEST_AUTOCOMPLETE_H
|
||||
#define TESTS_TEST_AUTOCOMPLETE_H
|
||||
|
||||
void autocomplete_complete__returns__null_when_empty(void** state);
|
||||
void autocomplete_reset__updates__after_create(void** state);
|
||||
void autocomplete_complete__returns__null_after_create(void** state);
|
||||
void autocomplete_complete__handles__escaped_spaces(void** state);
|
||||
void autocomplete_complete__handles__escaped_quotes(void** state);
|
||||
void autocomplete_create_list__returns__null_after_create(void** state);
|
||||
void autocomplete_add__updates__one_and_complete(void** state);
|
||||
void autocomplete_complete__returns__first_of_two(void** state);
|
||||
void autocomplete_complete__returns__second_of_two(void** state);
|
||||
void autocomplete_add__updates__two_elements(void** state);
|
||||
void autocomplete_add__updates__only_once_for_same_value(void** state);
|
||||
void autocomplete_add__updates__existing_value(void** state);
|
||||
void autocomplete_complete__returns__accented_with_accented(void** state);
|
||||
void autocomplete_complete__returns__accented_with_base(void** state);
|
||||
void autocomplete_complete__returns__both_with_accented(void** state);
|
||||
void autocomplete_complete__returns__both_with_base(void** state);
|
||||
void autocomplete_complete__is__case_insensitive(void** state);
|
||||
void autocomplete_complete__returns__previous(void** state);
|
||||
void autocomplete_complete__returns__greek(void** state);
|
||||
void autocomplete_complete__returns__greek_false_match(void** state);
|
||||
void autocomplete_complete__returns__greek_case_insensitive(void** state);
|
||||
void autocomplete_complete__returns__russian(void** state);
|
||||
void autocomplete_complete__returns__chinese(void** state);
|
||||
void autocomplete_complete__returns__transliterated(void** state);
|
||||
void autocomplete_complete__returns__regular_ascii(void** state);
|
||||
|
||||
#endif
|
||||
@@ -1,765 +0,0 @@
|
||||
#include "prof_cmocka.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "tools/parser.h"
|
||||
|
||||
void
|
||||
parse_args__returns__null_from_null(void** state)
|
||||
{
|
||||
char* inp = NULL;
|
||||
gboolean result = TRUE;
|
||||
gchar** args = parse_args(inp, 1, 2, &result);
|
||||
|
||||
assert_false(result);
|
||||
assert_null(args);
|
||||
g_strfreev(args);
|
||||
}
|
||||
|
||||
void
|
||||
parse_args__returns__null_from_empty(void** state)
|
||||
{
|
||||
char* inp = "";
|
||||
gboolean result = TRUE;
|
||||
gchar** args = parse_args(inp, 1, 2, &result);
|
||||
|
||||
assert_false(result);
|
||||
assert_null(args);
|
||||
g_strfreev(args);
|
||||
}
|
||||
|
||||
void
|
||||
parse_args__returns__null_from_space(void** state)
|
||||
{
|
||||
char* inp = " ";
|
||||
gboolean result = TRUE;
|
||||
gchar** args = parse_args(inp, 1, 2, &result);
|
||||
|
||||
assert_false(result);
|
||||
assert_null(args);
|
||||
g_strfreev(args);
|
||||
}
|
||||
|
||||
void
|
||||
parse_args__returns__null_when_no_args(void** state)
|
||||
{
|
||||
char* inp = "/cmd";
|
||||
gboolean result = TRUE;
|
||||
gchar** args = parse_args(inp, 1, 2, &result);
|
||||
|
||||
assert_false(result);
|
||||
assert_null(args);
|
||||
g_strfreev(args);
|
||||
}
|
||||
|
||||
void
|
||||
parse_args__returns__null_from_cmd_with_space(void** state)
|
||||
{
|
||||
char* inp = "/cmd ";
|
||||
gboolean result = TRUE;
|
||||
gchar** args = parse_args(inp, 1, 2, &result);
|
||||
|
||||
assert_false(result);
|
||||
assert_null(args);
|
||||
g_strfreev(args);
|
||||
}
|
||||
|
||||
void
|
||||
parse_args__returns__null_when_too_few(void** state)
|
||||
{
|
||||
char* inp = "/cmd arg1";
|
||||
gboolean result = TRUE;
|
||||
gchar** args = parse_args(inp, 2, 3, &result);
|
||||
|
||||
assert_false(result);
|
||||
assert_null(args);
|
||||
g_strfreev(args);
|
||||
}
|
||||
|
||||
void
|
||||
parse_args__returns__null_when_too_many(void** state)
|
||||
{
|
||||
char* inp = "/cmd arg1 arg2 arg3 arg4";
|
||||
gboolean result = TRUE;
|
||||
gchar** args = parse_args(inp, 1, 3, &result);
|
||||
|
||||
assert_false(result);
|
||||
assert_null(args);
|
||||
g_strfreev(args);
|
||||
}
|
||||
|
||||
void
|
||||
parse_args__returns__one_arg(void** state)
|
||||
{
|
||||
char* inp = "/cmd arg1";
|
||||
gboolean result = FALSE;
|
||||
gchar** args = parse_args(inp, 1, 2, &result);
|
||||
|
||||
assert_true(result);
|
||||
assert_int_equal(1, g_strv_length(args));
|
||||
assert_string_equal("arg1", args[0]);
|
||||
g_strfreev(args);
|
||||
}
|
||||
|
||||
void
|
||||
parse_args__returns__two_args(void** state)
|
||||
{
|
||||
char* inp = "/cmd arg1 arg2";
|
||||
gboolean result = FALSE;
|
||||
gchar** args = parse_args(inp, 1, 2, &result);
|
||||
|
||||
assert_true(result);
|
||||
assert_int_equal(2, g_strv_length(args));
|
||||
assert_string_equal("arg1", args[0]);
|
||||
assert_string_equal("arg2", args[1]);
|
||||
g_strfreev(args);
|
||||
}
|
||||
|
||||
void
|
||||
parse_args__returns__three_args(void** state)
|
||||
{
|
||||
char* inp = "/cmd arg1 arg2 arg3";
|
||||
gboolean result = FALSE;
|
||||
gchar** args = parse_args(inp, 3, 3, &result);
|
||||
|
||||
assert_true(result);
|
||||
assert_int_equal(3, g_strv_length(args));
|
||||
assert_string_equal("arg1", args[0]);
|
||||
assert_string_equal("arg2", args[1]);
|
||||
assert_string_equal("arg3", args[2]);
|
||||
g_strfreev(args);
|
||||
}
|
||||
|
||||
void
|
||||
parse_args__returns__three_args_with_spaces(void** state)
|
||||
{
|
||||
char* inp = " /cmd arg1 arg2 arg3 ";
|
||||
gboolean result = FALSE;
|
||||
gchar** args = parse_args(inp, 3, 3, &result);
|
||||
|
||||
assert_true(result);
|
||||
assert_int_equal(3, g_strv_length(args));
|
||||
assert_string_equal("arg1", args[0]);
|
||||
assert_string_equal("arg2", args[1]);
|
||||
assert_string_equal("arg3", args[2]);
|
||||
g_strfreev(args);
|
||||
}
|
||||
|
||||
void
|
||||
parse_args_with_freetext__returns__freetext(void** state)
|
||||
{
|
||||
char* inp = "/cmd this is some free text";
|
||||
gboolean result = FALSE;
|
||||
gchar** args = parse_args_with_freetext(inp, 1, 1, &result);
|
||||
|
||||
assert_true(result);
|
||||
assert_int_equal(1, g_strv_length(args));
|
||||
assert_string_equal("this is some free text", args[0]);
|
||||
g_strfreev(args);
|
||||
}
|
||||
|
||||
void
|
||||
parse_args_with_freetext__returns__one_arg_with_freetext(void** state)
|
||||
{
|
||||
char* inp = "/cmd arg1 this is some free text";
|
||||
gboolean result = FALSE;
|
||||
gchar** args = parse_args_with_freetext(inp, 1, 2, &result);
|
||||
|
||||
assert_true(result);
|
||||
assert_int_equal(2, g_strv_length(args));
|
||||
assert_string_equal("arg1", args[0]);
|
||||
assert_string_equal("this is some free text", args[1]);
|
||||
g_strfreev(args);
|
||||
}
|
||||
|
||||
void
|
||||
parse_args_with_freetext__returns__two_args_with_freetext(void** state)
|
||||
{
|
||||
char* inp = "/cmd arg1 arg2 this is some free text";
|
||||
gboolean result = FALSE;
|
||||
gchar** args = parse_args_with_freetext(inp, 1, 3, &result);
|
||||
|
||||
assert_true(result);
|
||||
assert_int_equal(3, g_strv_length(args));
|
||||
assert_string_equal("arg1", args[0]);
|
||||
assert_string_equal("arg2", args[1]);
|
||||
assert_string_equal("this is some free text", args[2]);
|
||||
g_strfreev(args);
|
||||
}
|
||||
|
||||
void
|
||||
parse_args__returns__zero_args_when_min_zero(void** state)
|
||||
{
|
||||
char* inp = "/cmd";
|
||||
gboolean result = FALSE;
|
||||
gchar** args = parse_args(inp, 0, 2, &result);
|
||||
|
||||
assert_true(result);
|
||||
assert_int_equal(0, g_strv_length(args));
|
||||
assert_null(args[0]);
|
||||
g_strfreev(args);
|
||||
}
|
||||
|
||||
void
|
||||
parse_args_with_freetext__returns__zero_args_when_min_zero(void** state)
|
||||
{
|
||||
char* inp = "/cmd";
|
||||
gboolean result = FALSE;
|
||||
gchar** args = parse_args_with_freetext(inp, 0, 2, &result);
|
||||
|
||||
assert_true(result);
|
||||
assert_int_equal(0, g_strv_length(args));
|
||||
assert_null(args[0]);
|
||||
g_strfreev(args);
|
||||
}
|
||||
|
||||
void
|
||||
parse_args__returns__quoted_args(void** state)
|
||||
{
|
||||
char* inp = "/cmd \"arg1\" arg2";
|
||||
gboolean result = FALSE;
|
||||
gchar** args = parse_args(inp, 2, 2, &result);
|
||||
|
||||
assert_true(result);
|
||||
assert_int_equal(2, g_strv_length(args));
|
||||
assert_string_equal("arg1", args[0]);
|
||||
assert_string_equal("arg2", args[1]);
|
||||
g_strfreev(args);
|
||||
}
|
||||
|
||||
void
|
||||
parse_args__returns__quoted_args_with_space(void** state)
|
||||
{
|
||||
char* inp = "/cmd \"the arg1\" arg2";
|
||||
gboolean result = FALSE;
|
||||
gchar** args = parse_args(inp, 2, 2, &result);
|
||||
|
||||
assert_true(result);
|
||||
assert_int_equal(2, g_strv_length(args));
|
||||
assert_string_equal("the arg1", args[0]);
|
||||
assert_string_equal("arg2", args[1]);
|
||||
g_strfreev(args);
|
||||
}
|
||||
|
||||
void
|
||||
parse_args__returns__quoted_args_with_many_spaces(void** state)
|
||||
{
|
||||
char* inp = "/cmd \"the arg1 is here\" arg2";
|
||||
gboolean result = FALSE;
|
||||
gchar** args = parse_args(inp, 2, 2, &result);
|
||||
|
||||
assert_true(result);
|
||||
assert_int_equal(2, g_strv_length(args));
|
||||
assert_string_equal("the arg1 is here", args[0]);
|
||||
assert_string_equal("arg2", args[1]);
|
||||
g_strfreev(args);
|
||||
}
|
||||
|
||||
void
|
||||
parse_args__returns__many_quoted_args_with_many_spaces(void** state)
|
||||
{
|
||||
char* inp = "/cmd \"the arg1 is here\" \"and arg2 is right here\"";
|
||||
gboolean result = FALSE;
|
||||
gchar** args = parse_args(inp, 2, 2, &result);
|
||||
|
||||
assert_true(result);
|
||||
assert_int_equal(2, g_strv_length(args));
|
||||
assert_string_equal("the arg1 is here", args[0]);
|
||||
assert_string_equal("and arg2 is right here", args[1]);
|
||||
g_strfreev(args);
|
||||
}
|
||||
|
||||
void
|
||||
parse_args_with_freetext__returns__quoted_args(void** state)
|
||||
{
|
||||
char* inp = "/cmd \"arg1\" arg2 hello there what's up";
|
||||
gboolean result = FALSE;
|
||||
gchar** args = parse_args_with_freetext(inp, 3, 3, &result);
|
||||
|
||||
assert_true(result);
|
||||
assert_int_equal(3, g_strv_length(args));
|
||||
assert_string_equal("arg1", args[0]);
|
||||
assert_string_equal("arg2", args[1]);
|
||||
assert_string_equal("hello there what's up", args[2]);
|
||||
g_strfreev(args);
|
||||
}
|
||||
|
||||
void
|
||||
parse_args_with_freetext__returns__quoted_args_with_space(void** state)
|
||||
{
|
||||
char* inp = "/cmd \"the arg1\" arg2 another bit of freetext";
|
||||
gboolean result = FALSE;
|
||||
gchar** args = parse_args_with_freetext(inp, 3, 3, &result);
|
||||
|
||||
assert_true(result);
|
||||
assert_int_equal(3, g_strv_length(args));
|
||||
assert_string_equal("the arg1", args[0]);
|
||||
assert_string_equal("arg2", args[1]);
|
||||
assert_string_equal("another bit of freetext", args[2]);
|
||||
g_strfreev(args);
|
||||
}
|
||||
|
||||
void
|
||||
parse_args_with_freetext__returns__quoted_args_with_many_spaces(void** state)
|
||||
{
|
||||
char* inp = "/cmd \"the arg1 is here\" arg2 some more freetext";
|
||||
gboolean result = FALSE;
|
||||
gchar** args = parse_args_with_freetext(inp, 3, 3, &result);
|
||||
|
||||
assert_true(result);
|
||||
assert_int_equal(3, g_strv_length(args));
|
||||
assert_string_equal("the arg1 is here", args[0]);
|
||||
assert_string_equal("arg2", args[1]);
|
||||
assert_string_equal("some more freetext", args[2]);
|
||||
g_strfreev(args);
|
||||
}
|
||||
|
||||
void
|
||||
parse_args_with_freetext__returns__many_quoted_args_with_many_spaces(void** state)
|
||||
{
|
||||
char* inp = "/cmd \"the arg1 is here\" \"and arg2 is right here\" and heres the free text";
|
||||
gboolean result = FALSE;
|
||||
gchar** args = parse_args_with_freetext(inp, 3, 3, &result);
|
||||
|
||||
assert_true(result);
|
||||
assert_int_equal(3, g_strv_length(args));
|
||||
assert_string_equal("the arg1 is here", args[0]);
|
||||
assert_string_equal("and arg2 is right here", args[1]);
|
||||
assert_string_equal("and heres the free text", args[2]);
|
||||
g_strfreev(args);
|
||||
}
|
||||
|
||||
void
|
||||
parse_args_with_freetext__returns__quoted_freetext(void** state)
|
||||
{
|
||||
char* inp = "/cmd arg1 here is \"some\" quoted freetext";
|
||||
gboolean result = FALSE;
|
||||
gchar** args = parse_args_with_freetext(inp, 1, 2, &result);
|
||||
|
||||
assert_true(result);
|
||||
assert_int_equal(2, g_strv_length(args));
|
||||
assert_string_equal("arg1", args[0]);
|
||||
assert_string_equal("here is \"some\" quoted freetext", args[1]);
|
||||
g_strfreev(args);
|
||||
}
|
||||
|
||||
void
|
||||
parse_args_with_freetext__returns__quoted_start_of_freetext(void** state)
|
||||
{
|
||||
char* inp = "/cmd arg1 \"arg2 with space\" more text";
|
||||
gboolean result = FALSE;
|
||||
gchar** args = parse_args_with_freetext(inp, 1, 2, &result);
|
||||
|
||||
assert_true(result);
|
||||
assert_int_equal(2, g_strv_length(args));
|
||||
assert_string_equal("arg1", args[0]);
|
||||
assert_string_equal("\"arg2 with space\" more text", args[1]);
|
||||
g_strfreev(args);
|
||||
}
|
||||
|
||||
void
|
||||
parse_args_with_freetext__returns__third_arg_quoted(void** state)
|
||||
{
|
||||
char* inp = "/group add friends \"The User\"";
|
||||
gboolean result = FALSE;
|
||||
gchar** args = parse_args_with_freetext(inp, 0, 3, &result);
|
||||
|
||||
assert_true(result);
|
||||
assert_int_equal(3, g_strv_length(args));
|
||||
assert_string_equal("add", args[0]);
|
||||
assert_string_equal("friends", args[1]);
|
||||
assert_string_equal("The User", args[2]);
|
||||
|
||||
g_strfreev(args);
|
||||
}
|
||||
|
||||
void
|
||||
parse_args_with_freetext__returns__second_arg_quoted(void** state)
|
||||
{
|
||||
char* inp = "/group add \"The Group\" friend";
|
||||
gboolean result = FALSE;
|
||||
gchar** args = parse_args_with_freetext(inp, 0, 3, &result);
|
||||
|
||||
assert_true(result);
|
||||
assert_int_equal(3, g_strv_length(args));
|
||||
assert_string_equal("add", args[0]);
|
||||
assert_string_equal("The Group", args[1]);
|
||||
assert_string_equal("friend", args[2]);
|
||||
|
||||
g_strfreev(args);
|
||||
}
|
||||
|
||||
void
|
||||
parse_args_with_freetext__returns__second_and_third_arg_quoted(void** state)
|
||||
{
|
||||
char* inp = "/group add \"The Group\" \"The User\"";
|
||||
gboolean result = FALSE;
|
||||
gchar** args = parse_args_with_freetext(inp, 0, 3, &result);
|
||||
|
||||
assert_true(result);
|
||||
assert_int_equal(3, g_strv_length(args));
|
||||
assert_string_equal("add", args[0]);
|
||||
assert_string_equal("The Group", args[1]);
|
||||
assert_string_equal("The User", args[2]);
|
||||
|
||||
g_strfreev(args);
|
||||
}
|
||||
|
||||
void
|
||||
parse_args__returns__escaped_quotes(void** state)
|
||||
{
|
||||
char* inp = "/cmd \"Thor \\\"The Thunderer\\\" Odinson\" arg2";
|
||||
gboolean result = FALSE;
|
||||
gchar** args = parse_args(inp, 2, 2, &result);
|
||||
|
||||
assert_true(result);
|
||||
assert_int_equal(2, g_strv_length(args));
|
||||
assert_string_equal("Thor \"The Thunderer\" Odinson", args[0]);
|
||||
assert_string_equal("arg2", args[1]);
|
||||
g_strfreev(args);
|
||||
}
|
||||
|
||||
void
|
||||
parse_args__returns__escaped_spaces(void** state)
|
||||
{
|
||||
char* inp = "/cmd Thor\\ The\\ Thunderer\\ Odinson arg2";
|
||||
gboolean result = FALSE;
|
||||
gchar** args = parse_args(inp, 2, 2, &result);
|
||||
|
||||
assert_true(result);
|
||||
assert_int_equal(2, g_strv_length(args));
|
||||
assert_string_equal("Thor The Thunderer Odinson", args[0]);
|
||||
assert_string_equal("arg2", args[1]);
|
||||
g_strfreev(args);
|
||||
}
|
||||
|
||||
void
|
||||
parse_args__returns__escaped_backslash(void** state)
|
||||
{
|
||||
char* inp = "/cmd \"Thor \\\\ Odinson\" arg2";
|
||||
gboolean result = FALSE;
|
||||
gchar** args = parse_args(inp, 2, 2, &result);
|
||||
|
||||
assert_true(result);
|
||||
assert_int_equal(2, g_strv_length(args));
|
||||
assert_string_equal("Thor \\ Odinson", args[0]);
|
||||
assert_string_equal("arg2", args[1]);
|
||||
g_strfreev(args);
|
||||
}
|
||||
|
||||
void
|
||||
count_tokens__returns__one_token(void** state)
|
||||
{
|
||||
char* inp = "one";
|
||||
int result = count_tokens(inp);
|
||||
|
||||
assert_int_equal(1, result);
|
||||
}
|
||||
|
||||
void
|
||||
count_tokens__returns__one_token_quoted_no_whitespace(void** state)
|
||||
{
|
||||
char* inp = "\"one\"";
|
||||
int result = count_tokens(inp);
|
||||
|
||||
assert_int_equal(1, result);
|
||||
}
|
||||
|
||||
void
|
||||
count_tokens__returns__one_token_quoted_with_whitespace(void** state)
|
||||
{
|
||||
char* inp = "\"one two\"";
|
||||
int result = count_tokens(inp);
|
||||
|
||||
assert_int_equal(1, result);
|
||||
}
|
||||
|
||||
void
|
||||
count_tokens__returns__two_tokens(void** state)
|
||||
{
|
||||
char* inp = "one two";
|
||||
int result = count_tokens(inp);
|
||||
|
||||
assert_int_equal(2, result);
|
||||
}
|
||||
|
||||
void
|
||||
count_tokens__returns__two_tokens_first_quoted(void** state)
|
||||
{
|
||||
char* inp = "\"one and\" two";
|
||||
int result = count_tokens(inp);
|
||||
|
||||
assert_int_equal(2, result);
|
||||
}
|
||||
|
||||
void
|
||||
count_tokens__returns__two_tokens_second_quoted(void** state)
|
||||
{
|
||||
char* inp = "one \"two and\"";
|
||||
int result = count_tokens(inp);
|
||||
|
||||
assert_int_equal(2, result);
|
||||
}
|
||||
|
||||
void
|
||||
count_tokens__returns__two_tokens_both_quoted(void** state)
|
||||
{
|
||||
char* inp = "\"one and then\" \"two and\"";
|
||||
int result = count_tokens(inp);
|
||||
|
||||
assert_int_equal(2, result);
|
||||
}
|
||||
|
||||
void
|
||||
count_tokens__handles__escapes(void** state)
|
||||
{
|
||||
char* inp = "one\\ two \"three \\\" four\"";
|
||||
int result = count_tokens(inp);
|
||||
|
||||
assert_int_equal(2, result);
|
||||
}
|
||||
|
||||
void
|
||||
count_tokens__handles__multiple_spaces(void** state)
|
||||
{
|
||||
char* inp = "one two";
|
||||
int result = count_tokens(inp);
|
||||
|
||||
assert_int_equal(2, result);
|
||||
}
|
||||
|
||||
void
|
||||
get_start__returns__first_of_one(void** state)
|
||||
{
|
||||
char* inp = "one";
|
||||
char* result = get_start(inp, 2);
|
||||
|
||||
assert_string_equal("one", result);
|
||||
g_free(result);
|
||||
}
|
||||
|
||||
void
|
||||
get_start__returns__first_of_two(void** state)
|
||||
{
|
||||
char* inp = "one two";
|
||||
char* result = get_start(inp, 2);
|
||||
|
||||
assert_string_equal("one ", result);
|
||||
g_free(result);
|
||||
}
|
||||
|
||||
void
|
||||
get_start__returns__first_two_of_three(void** state)
|
||||
{
|
||||
char* inp = "one two three";
|
||||
char* result = get_start(inp, 3);
|
||||
|
||||
assert_string_equal("one two ", result);
|
||||
g_free(result);
|
||||
}
|
||||
|
||||
void
|
||||
get_start__returns__first_two_of_three_first_quoted(void** state)
|
||||
{
|
||||
char* inp = "\"one\" two three";
|
||||
char* result = get_start(inp, 3);
|
||||
|
||||
assert_string_equal("\"one\" two ", result);
|
||||
g_free(result);
|
||||
}
|
||||
|
||||
void
|
||||
get_start__returns__first_two_of_three_second_quoted(void** state)
|
||||
{
|
||||
char* inp = "one \"two\" three";
|
||||
char* result = get_start(inp, 3);
|
||||
|
||||
assert_string_equal("one \"two\" ", result);
|
||||
g_free(result);
|
||||
}
|
||||
|
||||
void
|
||||
get_start__returns__first_two_of_three_first_and_second_quoted(void** state)
|
||||
{
|
||||
char* inp = "\"one\" \"two\" three";
|
||||
char* result = get_start(inp, 3);
|
||||
|
||||
assert_string_equal("\"one\" \"two\" ", result);
|
||||
g_free(result);
|
||||
}
|
||||
|
||||
void
|
||||
get_start__handles__escapes(void** state)
|
||||
{
|
||||
char* inp = "one\\ two three";
|
||||
char* result = get_start(inp, 2);
|
||||
|
||||
assert_string_equal("one\\ two ", result);
|
||||
g_free(result);
|
||||
}
|
||||
|
||||
void
|
||||
get_start__handles__multiple_spaces(void** state)
|
||||
{
|
||||
char* inp = "one two";
|
||||
char* result = get_start(inp, 2);
|
||||
|
||||
assert_string_equal("one ", result);
|
||||
g_free(result);
|
||||
}
|
||||
|
||||
void
|
||||
parse_options__returns__empty_hashmap_when_none(void** state)
|
||||
{
|
||||
gchar* args[] = { "cmd1", "cmd2", NULL };
|
||||
gchar* keys[] = { "opt1", NULL };
|
||||
|
||||
gboolean res = FALSE;
|
||||
|
||||
GHashTable* options = parse_options(&args[2], keys, &res);
|
||||
|
||||
assert_true(options != NULL);
|
||||
assert_int_equal(0, g_hash_table_size(options));
|
||||
assert_true(res);
|
||||
|
||||
options_destroy(options);
|
||||
}
|
||||
|
||||
void
|
||||
parse_options__returns__error_when_opt1_no_val(void** state)
|
||||
{
|
||||
gchar* args[] = { "cmd1", "cmd2", "opt1", NULL };
|
||||
gchar* keys[] = { "opt1", NULL };
|
||||
|
||||
gboolean res = TRUE;
|
||||
|
||||
GHashTable* options = parse_options(&args[2], keys, &res);
|
||||
|
||||
assert_null(options);
|
||||
assert_false(res);
|
||||
|
||||
options_destroy(options);
|
||||
}
|
||||
|
||||
void
|
||||
parse_options__returns__map_when_one(void** state)
|
||||
{
|
||||
gchar* args[] = { "cmd1", "cmd2", "opt1", "val1", NULL };
|
||||
gchar* keys[] = { "opt1", NULL };
|
||||
|
||||
gboolean res = FALSE;
|
||||
|
||||
GHashTable* options = parse_options(&args[2], keys, &res);
|
||||
|
||||
assert_int_equal(1, g_hash_table_size(options));
|
||||
assert_true(g_hash_table_contains(options, "opt1"));
|
||||
assert_string_equal("val1", g_hash_table_lookup(options, "opt1"));
|
||||
assert_true(res);
|
||||
|
||||
options_destroy(options);
|
||||
}
|
||||
|
||||
void
|
||||
parse_options__returns__error_when_opt2_no_val(void** state)
|
||||
{
|
||||
gchar* args[] = { "cmd1", "cmd2", "opt1", "val1", "opt2", NULL };
|
||||
gchar* keys[] = { "opt1", "opt2", NULL };
|
||||
|
||||
gboolean res = TRUE;
|
||||
|
||||
GHashTable* options = parse_options(&args[2], keys, &res);
|
||||
|
||||
assert_null(options);
|
||||
assert_false(res);
|
||||
|
||||
options_destroy(options);
|
||||
}
|
||||
|
||||
void
|
||||
parse_options__returns__map_when_two(void** state)
|
||||
{
|
||||
gchar* args[] = { "cmd1", "cmd2", "opt1", "val1", "opt2", "val2", NULL };
|
||||
gchar* keys[] = { "opt1", "opt2", NULL };
|
||||
|
||||
gboolean res = FALSE;
|
||||
|
||||
GHashTable* options = parse_options(&args[2], keys, &res);
|
||||
|
||||
assert_int_equal(2, g_hash_table_size(options));
|
||||
assert_true(g_hash_table_contains(options, "opt1"));
|
||||
assert_true(g_hash_table_contains(options, "opt2"));
|
||||
assert_string_equal("val1", g_hash_table_lookup(options, "opt1"));
|
||||
assert_string_equal("val2", g_hash_table_lookup(options, "opt2"));
|
||||
assert_true(res);
|
||||
|
||||
options_destroy(options);
|
||||
}
|
||||
|
||||
void
|
||||
parse_options__returns__error_when_opt3_no_val(void** state)
|
||||
{
|
||||
gchar* args[] = { "cmd1", "cmd2", "opt1", "val1", "opt2", "val2", "opt3", NULL };
|
||||
gchar* keys[] = { "opt1", "opt2", "opt3", NULL };
|
||||
|
||||
gboolean res = TRUE;
|
||||
|
||||
GHashTable* options = parse_options(&args[2], keys, &res);
|
||||
|
||||
assert_null(options);
|
||||
assert_false(res);
|
||||
|
||||
options_destroy(options);
|
||||
}
|
||||
|
||||
void
|
||||
parse_options__returns__map_when_three(void** state)
|
||||
{
|
||||
gchar* args[] = { "cmd1", "cmd2", "opt1", "val1", "opt2", "val2", "opt3", "val3", NULL };
|
||||
gchar* keys[] = { "opt1", "opt2", "opt3", NULL };
|
||||
|
||||
gboolean res = FALSE;
|
||||
|
||||
GHashTable* options = parse_options(&args[2], keys, &res);
|
||||
|
||||
assert_int_equal(3, g_hash_table_size(options));
|
||||
assert_true(g_hash_table_contains(options, "opt1"));
|
||||
assert_true(g_hash_table_contains(options, "opt2"));
|
||||
assert_true(g_hash_table_contains(options, "opt3"));
|
||||
assert_string_equal("val1", g_hash_table_lookup(options, "opt1"));
|
||||
assert_string_equal("val2", g_hash_table_lookup(options, "opt2"));
|
||||
assert_string_equal("val3", g_hash_table_lookup(options, "opt3"));
|
||||
assert_true(res);
|
||||
|
||||
options_destroy(options);
|
||||
}
|
||||
|
||||
void
|
||||
parse_options__returns__error_when_unknown_opt(void** state)
|
||||
{
|
||||
gchar* args[] = { "cmd1", "cmd2", "opt1", "val1", "oops", "val2", "opt3", "val3", NULL };
|
||||
gchar* keys[] = { "opt1", "opt2", "opt3", NULL };
|
||||
|
||||
gboolean res = TRUE;
|
||||
|
||||
GHashTable* options = parse_options(&args[2], keys, &res);
|
||||
|
||||
assert_null(options);
|
||||
assert_false(res);
|
||||
|
||||
options_destroy(options);
|
||||
}
|
||||
|
||||
void
|
||||
parse_options__returns__error_when_duplicated_option(void** state)
|
||||
{
|
||||
gchar* args[] = { "cmd1", "cmd2", "opt1", "val1", "opt2", "val2", "opt1", "val3", NULL };
|
||||
gchar* keys[] = { "opt1", "opt2", "opt3", NULL };
|
||||
|
||||
gboolean res = TRUE;
|
||||
|
||||
GHashTable* options = parse_options(&args[2], keys, &res);
|
||||
|
||||
assert_null(options);
|
||||
assert_false(res);
|
||||
|
||||
options_destroy(options);
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
#ifndef TESTS_TEST_PARSER_H
|
||||
#define TESTS_TEST_PARSER_H
|
||||
|
||||
void parse_args__returns__null_from_null(void** state);
|
||||
void parse_args__returns__null_from_empty(void** state);
|
||||
void parse_args__returns__null_from_space(void** state);
|
||||
void parse_args__returns__null_when_no_args(void** state);
|
||||
void parse_args__returns__null_from_cmd_with_space(void** state);
|
||||
void parse_args__returns__null_when_too_few(void** state);
|
||||
void parse_args__returns__null_when_too_many(void** state);
|
||||
void parse_args__returns__one_arg(void** state);
|
||||
void parse_args__returns__two_args(void** state);
|
||||
void parse_args__returns__three_args(void** state);
|
||||
void parse_args__returns__three_args_with_spaces(void** state);
|
||||
void parse_args_with_freetext__returns__freetext(void** state);
|
||||
void parse_args_with_freetext__returns__one_arg_with_freetext(void** state);
|
||||
void parse_args_with_freetext__returns__two_args_with_freetext(void** state);
|
||||
void parse_args__returns__zero_args_when_min_zero(void** state);
|
||||
void parse_args_with_freetext__returns__zero_args_when_min_zero(void** state);
|
||||
void parse_args__returns__quoted_args(void** state);
|
||||
void parse_args__returns__quoted_args_with_space(void** state);
|
||||
void parse_args__returns__quoted_args_with_many_spaces(void** state);
|
||||
void parse_args__returns__many_quoted_args_with_many_spaces(void** state);
|
||||
void parse_args_with_freetext__returns__quoted_args(void** state);
|
||||
void parse_args_with_freetext__returns__quoted_args_with_space(void** state);
|
||||
void parse_args_with_freetext__returns__quoted_args_with_many_spaces(void** state);
|
||||
void parse_args_with_freetext__returns__many_quoted_args_with_many_spaces(void** state);
|
||||
void parse_args_with_freetext__returns__quoted_freetext(void** state);
|
||||
void parse_args_with_freetext__returns__third_arg_quoted(void** state);
|
||||
void parse_args_with_freetext__returns__second_arg_quoted(void** state);
|
||||
void parse_args_with_freetext__returns__second_and_third_arg_quoted(void** state);
|
||||
void parse_args__returns__escaped_quotes(void** state);
|
||||
void parse_args__returns__escaped_spaces(void** state);
|
||||
void parse_args__returns__escaped_backslash(void** state);
|
||||
void count_tokens__returns__one_token(void** state);
|
||||
void count_tokens__returns__one_token_quoted_no_whitespace(void** state);
|
||||
void count_tokens__returns__one_token_quoted_with_whitespace(void** state);
|
||||
void count_tokens__returns__two_tokens(void** state);
|
||||
void count_tokens__returns__two_tokens_first_quoted(void** state);
|
||||
void count_tokens__returns__two_tokens_second_quoted(void** state);
|
||||
void count_tokens__returns__two_tokens_both_quoted(void** state);
|
||||
void count_tokens__handles__escapes(void** state);
|
||||
void count_tokens__handles__multiple_spaces(void** state);
|
||||
void get_start__returns__first_of_one(void** state);
|
||||
void get_start__returns__first_of_two(void** state);
|
||||
void get_start__returns__first_two_of_three(void** state);
|
||||
void get_start__returns__first_two_of_three_first_quoted(void** state);
|
||||
void get_start__returns__first_two_of_three_second_quoted(void** state);
|
||||
void get_start__returns__first_two_of_three_first_and_second_quoted(void** state);
|
||||
void get_start__handles__escapes(void** state);
|
||||
void get_start__handles__multiple_spaces(void** state);
|
||||
void parse_options__returns__empty_hashmap_when_none(void** state);
|
||||
void parse_options__returns__error_when_opt1_no_val(void** state);
|
||||
void parse_options__returns__map_when_one(void** state);
|
||||
void parse_options__returns__error_when_opt2_no_val(void** state);
|
||||
void parse_options__returns__map_when_two(void** state);
|
||||
void parse_options__returns__error_when_opt3_no_val(void** state);
|
||||
void parse_options__returns__map_when_three(void** state);
|
||||
void parse_options__returns__error_when_unknown_opt(void** state);
|
||||
void parse_options__returns__error_when_duplicated_option(void** state);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user