summary refs log tree commit diff stats
path: root/test.c
diff options
context:
space:
mode:
authorAli Fardan <raiz@stellarbound.space>2020-11-22 17:02:51 +0300
committerAli Fardan <raiz@stellarbound.space>2020-11-22 17:02:51 +0300
commit5a66aa1bbace4775025cd99a8ab0a8a18487dfe9 (patch)
treea40b9c727001661fb2200f06b87155a9e5a8db98 /test.c
parent7ea4eb3fe07564f605731b4b4eef09a47c0bfb08 (diff)
downloadlibyuri-5a66aa1bbace4775025cd99a8ab0a8a18487dfe9.tar.gz
- implement percent encoding in encode.c
- move syntax macros from decode.c to separate types.h header
- fix normalizer (sorta, needs testing)
- TODO: more testing...
Diffstat (limited to 'test.c')
-rw-r--r--test.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/test.c b/test.c
index c1cdd72..ff6b137 100644
--- a/test.c
+++ b/test.c
@@ -1,4 +1,5 @@
 #include <stdio.h>
+#include <stdlib.h>
 
 #include "yuri.h"
 
@@ -22,6 +23,7 @@ int
 main(int argc, char *argv[])
 {
 	struct uri *u;
+	char *p;
 
 	if (argc < 2) {
 		fprintf(stderr, "Usage %s url\n", argv[0]);
@@ -33,6 +35,11 @@ main(int argc, char *argv[])
 	if (uri_normalize(u) == -1)
 		return 1;
 	_print_uri(u);
+	p = uri_encode(u);
+	if (p == NULL)
+		return 1;
+	printf("%s\n", p);
+	free(p);
 	uri_free(u);
 	return 0;
 }