Fixes to make test target to work
[elinks.git] / src / protocol / test / uri-test.c
blobd694151c450f1de78119a5d9bd0d200b51880904
1 #ifdef HAVE_CONFIG_H
2 #include "config.h"
3 #endif
5 #include <stdio.h>
6 #include <stdlib.h>
8 #include "elinks.h"
10 #include "protocol/uri.h"
11 #include "util/string.h"
13 int
14 main(int argc, char **argv)
16 /* FIXME: As more protocol tests are added this could start
17 * taking arguments like --normalize-uri=<arg> etc. */
18 if (argc == 2) {
19 fprintf(stdout, "%s\n", normalize_uri(NULL, argv[1]));
20 } else if (argc == 3) {
21 struct uri *translated = get_translated_uri(argv[1], argv[2]);
22 if (translated == NULL)
23 return EXIT_FAILURE;
24 fprintf(stdout, "%s\n", struri(translated));
26 return 0;