summaryrefslogtreecommitdiff
path: root/mimetypes/tests/mimetest.c
diff options
context:
space:
mode:
Diffstat (limited to 'mimetypes/tests/mimetest.c')
-rw-r--r--mimetypes/tests/mimetest.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/mimetypes/tests/mimetest.c b/mimetypes/tests/mimetest.c
new file mode 100644
index 0000000..a0d3353
--- /dev/null
+++ b/mimetypes/tests/mimetest.c
@@ -0,0 +1,23 @@
+#include <stdio.h>
+#include <assert.h>
+#include "mimetypes.h"
+
+int
+main (int argc, char **argv)
+{
+ int i;
+ char const *type;
+ assert (argc >= 3);
+ assert (mimetypes_parse (argv[1]) == 0);
+ for (i = 2; i < argc; i++)
+ {
+ printf ("%s:", argv[i]);
+ type = get_file_type (argv[i]);
+ if (type)
+ printf (" %s", type);
+ putchar ('\n');
+ }
+ return 0;
+}
+
+

Return to:

Send suggestions and report system problems to the System administrator.