summaryrefslogtreecommitdiff
path: root/test.c
diff options
context:
space:
mode:
Diffstat (limited to 'test.c')
-rw-r--r--test.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/test.c b/test.c
index 802afc5..3738ced 100644
--- a/test.c
+++ b/test.c
@@ -3,6 +3,7 @@
#include "browse.h"
#include "delete.h"
+#include "download.h"
#include "http.h"
#include "upload.h"
#include "url.h"
@@ -92,6 +93,23 @@ test_upload_post()
}
static char *
+test_download()
+{
+ struct kreq r;
+ struct http_ret ret;
+
+ r = (struct kreq) {
+ .pname = "/vault",
+ .path = "a",
+ .suffix = "txt",
+ };
+ ret = download(&r);
+
+ mu_assert("error, download failed!", ret.code <= KHTTP_400);
+ return 0;
+}
+
+static char *
test_delete_get()
{
struct kreq r;
@@ -163,6 +181,7 @@ all_tests()
mu_run_test(test_browse_invalid_traversal);
mu_run_test(test_browse_path_too_long);
mu_run_test(test_url_build);
+ mu_run_test(test_download);
mu_run_test(test_upload_post);
mu_run_test(test_delete_get);
mu_run_test(test_delete_post);