nserver

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | LICENSE

commit 99e51b54078080c000c5520b56030aceb3678f34
parent 63c5da4f5f646d4c989e7760be46de86e3b01efe
Author: rsiddharth <s@ricketyspace.net>
Date:   Mon,  2 Dec 2019 19:27:21 -0500

nserver: ncmd_tests.c: Update test_find_function.

* nserver/tests/ncmd_tests.c (test_find_function): Add new checks.

Diffstat:
nserver/tests/ncmd_tests.c | 24++++++++++++++++++++++++
1 file changed, 24 insertions(+), 0 deletions(-)

diff --git a/nserver/tests/ncmd_tests.c b/nserver/tests/ncmd_tests.c @@ -152,12 +152,24 @@ char *test_find_function() funk = find_function(parts); mu_assert(funk == NS_CREATE, "find function create failed"); + ham = "/CREate ham"; + parts = cmd_parts(ham); + mu_assert(parts != NULL, "cmd_parts failed"); + funk = find_function(parts); + mu_assert(funk == NS_CREATE, "find function create failed"); + char *sample = "/sample bacon 42"; parts = cmd_parts(sample); mu_assert(parts != NULL, "cmd_parts failed"); funk = find_function(parts); mu_assert(funk == NS_SAMPLE, "find function sample failed"); + sample = "/SAMPLE bacon 42"; + parts = cmd_parts(sample); + mu_assert(parts != NULL, "cmd_parts failed"); + funk = find_function(parts); + mu_assert(funk == NS_SAMPLE, "find function sample failed"); + char *mean = "/mean bacon"; parts = cmd_parts(mean); mu_assert(parts != NULL, "cmd_parts failed"); @@ -182,6 +194,18 @@ char *test_find_function() funk = find_function(parts); mu_assert(funk == NS_LIST, "find function list failed"); + list = "/LIST"; + parts = cmd_parts(list); + mu_assert(parts != NULL, "cmp_parts failed"); + funk = find_function(parts); + mu_assert(funk == NS_LIST, "find function list failed"); + + char *nop = "/meant bacon"; + parts = cmd_parts(nop); + mu_assert(parts != NULL, "cmd_parts failed"); + funk = find_function(parts); + mu_assert(funk == NS_NOP, "find function mean failed"); + return NULL; }