very simple, very stupid proof of concept
[p5sagit/Email-Archive.git] / test_run
diff --git a/test_run b/test_run
new file mode 100644 (file)
index 0000000..0174bf4
--- /dev/null
+++ b/test_run
@@ -0,0 +1,25 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+use Email::Simple;
+use Email::Simple::Creator;
+
+use lib 'lib';
+use Email::Archive;
+
+my $email = Email::Simple->create(
+    header => [
+      From    => 'casey@geeknest.com',
+      To      => 'drain@example.com',
+      Subject => 'Message in a bottle',
+      'Message-ID' => 'helloworld',
+    ],
+    body => 'hello there!'
+);
+
+my $e = Email::Archive->new({dsn => 'dbi:SQLite:dbname=test.db'});
+print "sending @{[$email->as_string]}\n";
+$e->store($email);
+
+my $found = $e->retrieve('helloworld');
+print $found->as_string;