summaryrefslogtreecommitdiff
path: root/test.c
diff options
context:
space:
mode:
Diffstat (limited to 'test.c')
-rw-r--r--test.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/test.c b/test.c
index fe1703a..802afc5 100644
--- a/test.c
+++ b/test.c
@@ -2,6 +2,7 @@
#include <string.h>
#include "browse.h"
+#include "delete.h"
#include "http.h"
#include "upload.h"
#include "url.h"
@@ -91,6 +92,42 @@ test_upload_post()
}
static char *
+test_delete_get()
+{
+ struct kreq r;
+ struct http_ret ret;
+
+ r = (struct kreq) {
+ .pname = "/vault",
+ .path = "a",
+ .suffix = "txt",
+ .method = KMETHOD_GET,
+ };
+ ret = del(&r);
+
+ mu_assert("error, GET delete failed!", ret.code <= KHTTP_400);
+ return 0;
+}
+
+static char *
+test_delete_post()
+{
+ struct kreq r;
+ struct http_ret ret;
+
+ r = (struct kreq) {
+ .pname = "/vault",
+ .path = "Folder",
+ .suffix = "",
+ .method = KMETHOD_POST,
+ };
+ ret = del(&r);
+
+ mu_assert("error, POST delete failed!", ret.code <= KHTTP_400);
+ return 0;
+}
+
+static char *
test_url_build()
{
char dst[BUF_SZ], *expected;
@@ -127,6 +164,8 @@ all_tests()
mu_run_test(test_browse_path_too_long);
mu_run_test(test_url_build);
mu_run_test(test_upload_post);
+ mu_run_test(test_delete_get);
+ mu_run_test(test_delete_post);
return 0;
}