use strict;
use warnings;
use Test::More;
-use PublicInbox::MIME;
+use PublicInbox::Eml;
+use PublicInbox::Smsg;
use PublicInbox::Git;
use PublicInbox::Import;
use PublicInbox::Spawn qw(spawn);
my $git = PublicInbox::Git->new($dir);
my $im = PublicInbox::Import->new($git, 'testbox', 'test@example');
$im->init_bare;
-my $mime = PublicInbox::MIME->new(<<'EOF');
+my $mime = PublicInbox::Eml->new(<<'EOF');
From: a@example.com
To: b@example.com
Subject: this is a subject
EOF
my $v2 = require_git(2.6, 1);
-my $smsg = {} if $v2;
+my $smsg = bless {}, 'PublicInbox::Smsg' if $v2;
like($im->add($mime, undef, $smsg), qr/\A:[0-9]+\z/, 'added one message');
if ($v2) {
like($smsg->{blob}, qr/\A[a-f0-9]{40}\z/, 'got last object_id');
- is($mime->as_string, ${$smsg->{-raw_email}}, 'string matches');
- is($smsg->{bytes}, length(${$smsg->{-raw_email}}), 'length matches');
+ my $raw_email = $smsg->{-raw_email};
+ is($mime->as_string, $$raw_email, 'string matches');
+ is($smsg->{raw_bytes}, length($$raw_email), 'length matches');
my @cmd = ('git', "--git-dir=$git->{git_dir}", qw(hash-object --stdin));
my $in = tempfile();
print $in $mime->as_string or die "write failed: $!";