Make the date parsing accept pretty much any random crap.
[git.git] / test-date.c
diff --git a/test-date.c b/test-date.c
new file mode 100644 (file)
index 0000000..8ec41c3
--- /dev/null
@@ -0,0 +1,20 @@
+#include <stdio.h>
+#include <time.h>
+
+#include "cache.h"
+
+int main(int argc, char **argv)
+{
+       int i;
+
+       for (i = 1; i < argc; i++) {
+               char result[100];
+               time_t t;
+
+               memcpy(result, "bad", 4);
+               parse_date(argv[i], result, sizeof(result));
+               t = strtoul(result, NULL, 0);
+               printf("%s -> %s -> %s\n", argv[i], result, ctime(&t));
+       }
+       return 0;
+}