diff options
author | Niklas Halle <niklas@niklashalle.net> | 2020-05-22 09:53:42 +0200 |
---|---|---|
committer | Niklas Halle <niklas@niklashalle.net> | 2020-05-22 09:53:42 +0200 |
commit | 3b7e61eab8ce5d230bc1b172942c1ab9459ed161 (patch) | |
tree | 73da9a772782d7d1504770c8cc7582c03cf41310 /02_exercise/prompt_utils_test.c | |
parent | 68f5ff29c0aae1a176c25996aab0144badd0f092 (diff) | |
parent | 4f80f043aacc568fac0e3681b62aa1971a97291a (diff) | |
download | betriebssysteme-3b7e61eab8ce5d230bc1b172942c1ab9459ed161.tar.gz betriebssysteme-3b7e61eab8ce5d230bc1b172942c1ab9459ed161.zip |
Merge branch 'process_and_pipes' into dev/niklas
Diffstat (limited to '02_exercise/prompt_utils_test.c')
-rw-r--r-- | 02_exercise/prompt_utils_test.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/02_exercise/prompt_utils_test.c b/02_exercise/prompt_utils_test.c index f648275..8bc29de 100644 --- a/02_exercise/prompt_utils_test.c +++ b/02_exercise/prompt_utils_test.c @@ -4,20 +4,20 @@ #include <stdio.h> #include <string.h> -void test_get_seperator_indeces() { +void test_get_separator_indices() { char const *const test_str = "/This/is/a/test"; - size_t const *const result = get_seperator_indeces(test_str, '/'); + size_t const *const result = get_separator_indices(test_str, '/'); for (size_t i = 0; i < arrayLen(result); i++) { printf("%ld : %s \n", result[i], test_str + result[i]); } } void test_paths(char const *const from, char const *const to, char const *const expected) { - size_t const *const result = get_seperator_indeces(from, '/'); + size_t const *const result = get_separator_indices(from, '/'); for (size_t i = 0; i < arrayLen(result); i++) { printf("%ld : %s \n", result[i], from + result[i]); } - size_t const *const result2 = get_seperator_indeces(to, '/'); + size_t const *const result2 = get_separator_indices(to, '/'); for (size_t i = 0; i < arrayLen(result2); i++) { printf("%ld : %s \n", result2[i], to + result2[i]); } @@ -34,4 +34,12 @@ void test_relative_path() { test_paths("/", "/Test/a/asd", "./Test/a/asd"); test_paths("/Test/c", "/Test/b", "../b"); test_paths("/B/C", "/", "../.."); -}
\ No newline at end of file +} + +/* +int main(void) { + test_relative_path(); + test_get_separator_indices(); + return 0; +} +*/ |