very simple, very stupid proof of concept
[p5sagit/Email-Archive.git] / test_run
CommitLineData
8581da38 1#!/usr/bin/perl
2use strict;
3use warnings;
4use Email::Simple;
5use Email::Simple::Creator;
6
7use lib 'lib';
8use Email::Archive;
9
10my $email = Email::Simple->create(
11 header => [
12 From => 'casey@geeknest.com',
13 To => 'drain@example.com',
14 Subject => 'Message in a bottle',
15 'Message-ID' => 'helloworld',
16 ],
17 body => 'hello there!'
18);
19
20my $e = Email::Archive->new({dsn => 'dbi:SQLite:dbname=test.db'});
21print "sending @{[$email->as_string]}\n";
22$e->store($email);
23
24my $found = $e->retrieve('helloworld');
25print $found->as_string;