Index: lang/perl/Test-Snippet/tags/release-0.02/t/04_multiple_tests.t
===================================================================
--- lang/perl/Test-Snippet/tags/release-0.02/t/04_multiple_tests.t (revision 13680)
+++ lang/perl/Test-Snippet/tags/release-0.02/t/04_multiple_tests.t (revision 13680)
@@ -0,0 +1,32 @@
+use strict;
+use warnings;
+use Test::Snippet tests => 2;
+
+my $pod = join '', <DATA>;
+
+test_snippet_in_pod( $pod );
+
+__DATA__
+=head1 NAME
+
+Acme::Test - testing acme
+
+=head1 SYNOPSIS
+
+=begin snippet label1
+
+$ 3+2
+5
+
+=end snippet
+
+=begin snippet label2
+
+$ [2,5,5,{foo => 'bar'}]
+$ARRAY1 = [
+            2,
+            ( 5 ) x 2,
+            { foo => 'bar' }
+          ];
+
+=end snippet
Index: lang/perl/Test-Snippet/tags/release-0.02/t/03_pod.t
===================================================================
--- lang/perl/Test-Snippet/tags/release-0.02/t/03_pod.t (revision 13680)
+++ lang/perl/Test-Snippet/tags/release-0.02/t/03_pod.t (revision 13680)
@@ -0,0 +1,39 @@
+use strict;
+use warnings;
+use Test::Snippet tests => 1;
+
+test_snippet_in_pod(<<'...');
+
+your code here.
+
+=head1 NAME
+
+Acme::Test - testing acme
+
+=head1 DESCRIPTION
+
+blah blah blah
+
+=begin snippet
+
+$ 3+2
+5
+$ [2,5,5,{foo => 'bar'}]
+$ARRAY1 = [
+            2,
+            ( 5 ) x 2,
+            { foo => 'bar' }
+          ];
+
+=end test
+
+=cut
+
+something.. something..
+
+=head1 SEE ALSO
+
+ME!
+
+...
+
Index: lang/perl/Test-Snippet/tags/release-0.02/t/00_compile.t
===================================================================
--- lang/perl/Test-Snippet/tags/release-0.02/t/00_compile.t (revision 13670)
+++ lang/perl/Test-Snippet/tags/release-0.02/t/00_compile.t (revision 13670)
@@ -0,0 +1,4 @@
+use strict;
+use Test::More tests => 1;
+
+BEGIN { use_ok 'Test::Snippet' }
Index: lang/perl/Test-Snippet/tags/release-0.02/t/01_simple.t
===================================================================
--- lang/perl/Test-Snippet/tags/release-0.02/t/01_simple.t (revision 13670)
+++ lang/perl/Test-Snippet/tags/release-0.02/t/01_simple.t (revision 13670)
@@ -0,0 +1,18 @@
+use strict;
+use warnings;
+use Test::More tests => 1;
+use Test::Snippet;
+
+my $test = <<'...';
+$ 3+2
+5
+$ [2,5,5,{foo => 'bar'}]
+$ARRAY1 = [
+            2,
+            ( 5 ) x 2,
+            { foo => 'bar' }
+          ];
+...
+
+test_snippet($test);
+
Index: lang/perl/Test-Snippet/tags/release-0.02/t/02_fail.t
===================================================================
--- lang/perl/Test-Snippet/tags/release-0.02/t/02_fail.t (revision 13670)
+++ lang/perl/Test-Snippet/tags/release-0.02/t/02_fail.t (revision 13670)
@@ -0,0 +1,39 @@
+use strict;
+use warnings;
+use Test::Builder::Tester tests => 1;
+use Test::Snippet;
+
+my $test = <<'...';
+$ 3+2
+5
+$ [2,5,5,{foo => 'bar'}]
+$ARRA1 = [
+            2,
+            ( 5 ) x 2,
+            { foo => 'bar' }
+          ];
+$ substr("YATTA!", 3,2);
+TM
+...
+
+my $err = <<'...';
+#   Failed test at t/02_fail.t line 38.
+# @@ -1,9 +1,9 @@
+#  $VAR1 = [
+#            '5',
+# -          '$ARRAY1 = [
+# +          '$ARRA1 = [
+#              2,
+#              ( 5 ) x 2,
+#              { foo => \'bar\' }
+#            ];',
+# -          'TA'
+# +          'TM'
+#          ];
+...
+$err =~ s/\n$//;
+
+test_err($err);
+test_out('not ok 1');
+test_snippet($test);
+test_test("fail works");
Index: lang/perl/Test-Snippet/tags/release-0.02/MANIFEST
===================================================================
--- lang/perl/Test-Snippet/tags/release-0.02/MANIFEST (revision 13686)
+++ lang/perl/Test-Snippet/tags/release-0.02/MANIFEST (revision 13686)
@@ -0,0 +1,34 @@
+Changes
+inc/Module/Install.pm
+inc/Module/Install/AuthorTests.pm
+inc/Module/Install/Base.pm
+inc/Module/Install/Can.pm
+inc/Module/Install/Fetch.pm
+inc/Module/Install/Include.pm
+inc/Module/Install/Makefile.pm
+inc/Module/Install/Metadata.pm
+inc/Module/Install/TestBase.pm
+inc/Module/Install/Win32.pm
+inc/Module/Install/WriteAll.pm
+inc/Spiffy.pm
+inc/Test/Base.pm
+inc/Test/Base/Filter.pm
+inc/Test/Builder.pm
+inc/Test/Builder/Module.pm
+inc/Test/More.pm
+inc/YAML.pm
+lib/Test/Snippet.pm
+lib/Test/Snippet/Driver/DevelREPL.pm
+Makefile.PL
+MANIFEST			This list of files
+META.yml
+README
+t/00_compile.t
+t/01_simple.t
+t/02_fail.t
+t/03_pod.t
+t/04_multiple_tests.t
+xt/01_podspell.t
+xt/02_perlcritic.t
+xt/03_pod.t
+xt/perlcriticrc
Index: lang/perl/Test-Snippet/tags/release-0.02/lib/Test/Snippet/Driver/DevelREPL.pm
===================================================================
--- lang/perl/Test-Snippet/tags/release-0.02/lib/Test/Snippet/Driver/DevelREPL.pm (revision 13670)
+++ lang/perl/Test-Snippet/tags/release-0.02/lib/Test/Snippet/Driver/DevelREPL.pm (revision 13670)
@@ -0,0 +1,58 @@
+package Test::Snippet::Driver::DevelREPL;
+use Moose;
+use Devel::REPL;
+use Devel::REPL::Profile::Default;
+use IO::Scalar;
+
+my $term_mock = Moose::Meta::Class->create_anon_class(
+    methods => {
+        ReadLine => sub { 0 },
+    },
+)->new_object;
+
+has repl => (
+    is => 'ro',
+    isa => 'Devel::REPL',
+    default => sub {
+        my $repl = Devel::REPL->new( term => $term_mock );
+        Devel::REPL::Profile::Default->new->apply_profile($repl);
+        $repl;
+    },
+);
+
+sub run {
+    my ($self, $snippet) = @_;
+
+    my $state = 'init';
+    my @gots;
+    my @expecteds;
+    my @rets;
+    for my $line ( split /\n/, $snippet ) {
+        if ( $line =~ /^\$ (.+)$/ ) {
+            my $snippet = $1;
+            if ( $state eq 'ret' ) {
+                push @expecteds, join( "\n", @rets );
+                @rets = ();
+            }
+            my $fh = IO::Scalar->new( \my $out );
+            $self->repl->out_fh($fh);
+            my @err = $self->repl->eval($snippet);
+            $self->repl->print(@err);
+            $out =~ s/\n$//;
+            push @gots, $out;
+            $state = 'query';
+        }
+        else {
+            push @rets, $line;
+            $state = 'ret';
+        }
+    }
+    if ( $state eq 'ret' ) {
+        push @expecteds, join( "\n", @rets );
+    }
+
+    return \@gots, \@expecteds;
+}
+
+__PACKAGE__->meta->make_immutable;
+1;
Index: lang/perl/Test-Snippet/tags/release-0.02/lib/Test/Snippet.pm
===================================================================
--- lang/perl/Test-Snippet/tags/release-0.02/lib/Test/Snippet.pm (revision 14097)
+++ lang/perl/Test-Snippet/tags/release-0.02/lib/Test/Snippet.pm (revision 14097)
@@ -0,0 +1,135 @@
+package Test::Snippet;
+use strict;
+use warnings;
+use 5.00800;
+our $VERSION = '0.02';
+use base qw/Test::Builder::Module/;
+use Text::Diff qw(diff);
+use Data::Dumper;
+
+our @EXPORT = qw/test_snippet test_snippet_in_pod/;
+
+my $CLASS = __PACKAGE__;
+
+our $Dumper = \&Data::Dumper::Dumper;
+our $Driver;
+
+sub test_snippet {
+    my ($test, $label) = @_;
+
+    unless ($Driver) {
+        eval "use Test::Snippet::Driver::DevelREPL;"; ## no critic
+        die $@ if $@;
+        $Driver = Test::Snippet::Driver::DevelREPL->new();
+    }
+
+    my ($got, $expected) = $Driver->run($test);
+
+    my $got_dumped = $Dumper->($got);
+    my $expected_dumped = $Dumper->($expected);
+    my $diff = diff(\$got_dumped, \$expected_dumped);
+    $CLASS->builder->ok($got_dumped eq $expected_dumped, $label);
+    if ($diff) {
+        $CLASS->builder->diag($diff);
+    }
+}
+
+sub test_snippet_in_pod {
+    my $pod = shift;
+    require Pod::POM;
+
+    my $parser = Pod::POM->new();
+    my $pom = $parser->parse($pod) || die $parser->error;
+
+    my $traverse;
+    $traverse = sub {
+        my $c = shift;
+        for my $c ($c->content) {
+            if ($c->type eq 'text') {
+                # nop.
+            } elsif (($c->type eq 'begin' || $c->type eq 'for') && $c->format =~ /^snippet(?:\s+(.*)|$)/) {
+                my $label = $1;
+                # do it
+                test_snippet( $c->content, $label );
+            } else {
+                $traverse->($c); # recurse.
+            }
+        }
+    };
+
+    $traverse->($pom);
+}
+
+1;
+__END__
+
+=for stopwords doctest API FAQ
+
+=encoding utf8
+
+=head1 NAME
+
+Test::Snippet - doctest for perl
+
+=head1 SYNOPSIS
+
+    use Test::Snippet tests => 1;
+
+    # simple repl:
+    test_snippet(<<'...');
+    $ 3+2
+    5
+    ...
+
+    # tests in pod:
+    test_snippet_in_pod(<<'...');
+    =head1 DESCRIPTION
+
+    ...
+
+    =begin snippet
+
+    $ 4*5
+    20
+
+    =end
+    ...
+
+=head1 DESCRIPTION
+
+Test::Snippet is doctest for perl.
+
+THIS MODULE IS IN ITS BETA QUALITY. API MAY CHANGE IN THE FUTURE.
+
+=head1 FAQ
+
+=over 4
+
+=item How does this compare to Test::Inline, or Test::Pod::Snippets?
+
+Very similar.
+
+But, Test::Snippet way is based on REPL(read eval print loop).
+This is very readable and users can run in own console!
+
+=back
+
+=head1 AUTHOR
+
+Tokuhiro Matsuno E<lt>tokuhirom@gmail.comE<gt>
+
+=head1 THANKS TO
+
+    Tatsuhiko Miyagawa
+    charsbar
+
+=head1 SEE ALSO
+
+L<Test::Pod::Snippets>, L<Test::Inline>
+
+=head1 LICENSE
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=cut
Index: lang/perl/Test-Snippet/tags/release-0.02/Makefile.PL
===================================================================
--- lang/perl/Test-Snippet/tags/release-0.02/Makefile.PL (revision 14096)
+++ lang/perl/Test-Snippet/tags/release-0.02/Makefile.PL (revision 14096)
@@ -0,0 +1,17 @@
+use inc::Module::Install;
+name 'Test-Snippet';
+all_from 'lib/Test/Snippet.pm';
+
+requires 'Exporter' => '5.58';
+requires 'Test::Builder' => '0.80';
+requires 'Pod::POM' => 0.17;
+requires 'Devel::REPL' => '1.002001';
+requires 'Text::Diff' => 0.35;
+
+tests 't/*.t t/*/*.t t/*/*/*.t t/*/*/*/*.t';
+test_requires 'Test::More';
+test_requires 'YAML';
+author_tests 'xt';
+use_test_base;
+auto_include;
+WriteAll;
Index: lang/perl/Test-Snippet/tags/release-0.02/Changes
===================================================================
--- lang/perl/Test-Snippet/tags/release-0.02/Changes (revision 14097)
+++ lang/perl/Test-Snippet/tags/release-0.02/Changes (revision 14097)
@@ -0,0 +1,8 @@
+Revision history for Perl extension Test::Snippet
+
+0.02
+
+    - fixed deps
+
+0.01    Wed Jun 11 19:32:57 2008
+        - original version
Index: lang/perl/Test-Snippet/tags/release-0.02/MANIFEST.SKIP
===================================================================
--- lang/perl/Test-Snippet/tags/release-0.02/MANIFEST.SKIP (revision 13670)
+++ lang/perl/Test-Snippet/tags/release-0.02/MANIFEST.SKIP (revision 13670)
@@ -0,0 +1,19 @@
+\bRCS\b
+\bCVS\b
+^MANIFEST\.
+^Makefile$
+~$
+^#
+\.old$
+^blib/
+^pm_to_blib
+^MakeMaker-\d
+\.gz$
+\.cvsignore
+^t/perlcritic
+^tools/
+\.svn/
+^[^/]+\.yaml$
+^[^/]+\.pl$
+^\.shipit$
+\.sw[po]$
Index: lang/perl/Test-Snippet/tags/release-0.02/xt/02_perlcritic.t
===================================================================
--- lang/perl/Test-Snippet/tags/release-0.02/xt/02_perlcritic.t (revision 13670)
+++ lang/perl/Test-Snippet/tags/release-0.02/xt/02_perlcritic.t (revision 13670)
@@ -0,0 +1,5 @@
+use strict;
+use Test::More;
+eval { use Test::Perl::Critic -profile => 'xt/perlcriticrc' };
+plan skip_all => "Test::Perl::Critic is not installed." if $@;
+all_critic_ok('lib');
Index: lang/perl/Test-Snippet/tags/release-0.02/xt/01_podspell.t
===================================================================
--- lang/perl/Test-Snippet/tags/release-0.02/xt/01_podspell.t (revision 13670)
+++ lang/perl/Test-Snippet/tags/release-0.02/xt/01_podspell.t (revision 13670)
@@ -0,0 +1,32 @@
+use Test::More;
+eval q{ use Test::Spelling };
+plan skip_all => "Test::Spelling is not installed." if $@;
+add_stopwords(map { split /[\s\:\-]/ } <DATA>);
+$ENV{LANG} = 'C';
+all_pod_files_spelling_ok('lib');
+__DATA__
+Tokuhiro Matsuno
+Test::Snippet
+tokuhirom
+AAJKLFJEF
+GMAIL
+COM
+Tatsuhiko
+Miyagawa
+Kazuhiro
+Osawa
+lestrrat
+typester
+cho45
+charsbar
+coji
+clouder
+gunyarakun
+hio_d
+hirose31
+ikebe
+kan
+kazeburo
+daisuke
+maki
+TODO
Index: lang/perl/Test-Snippet/tags/release-0.02/xt/perlcriticrc
===================================================================
--- lang/perl/Test-Snippet/tags/release-0.02/xt/perlcriticrc (revision 13670)
+++ lang/perl/Test-Snippet/tags/release-0.02/xt/perlcriticrc (revision 13670)
@@ -0,0 +1,2 @@
+[TestingAndDebugging::ProhibitNoStrict]
+allow=refs
Index: lang/perl/Test-Snippet/tags/release-0.02/xt/03_pod.t
===================================================================
--- lang/perl/Test-Snippet/tags/release-0.02/xt/03_pod.t (revision 13670)
+++ lang/perl/Test-Snippet/tags/release-0.02/xt/03_pod.t (revision 13670)
@@ -0,0 +1,4 @@
+use Test::More;
+eval "use Test::Pod 1.00";
+plan skip_all => "Test::Pod 1.00 required for testing POD" if $@;
+all_pod_files_ok();
Index: lang/perl/Test-Snippet/tags/release-0.02/README
===================================================================
--- lang/perl/Test-Snippet/tags/release-0.02/README (revision 13670)
+++ lang/perl/Test-Snippet/tags/release-0.02/README (revision 13670)
@@ -0,0 +1,27 @@
+This is Perl module Test::Snippet.
+
+INSTALLATION
+
+Test::Snippet installation is straightforward. If your CPAN shell is set up,
+you should just be able to do
+
+    % cpan Test::Snippet
+
+Download it, unpack it, then build it as per the usual:
+
+    % perl Makefile.PL
+    % make && make test
+
+Then install it:
+
+    % make install
+
+DOCUMENTATION
+
+Test::Snippet documentation is available as in POD. So you can do:
+
+    % perldoc Test::Snippet
+
+to read the documentation online with your favorite pager.
+
+Tokuhiro Matsuno
Index: lang/perl/Test-Snippet/tags/release-0.02/.shipit
===================================================================
--- lang/perl/Test-Snippet/tags/release-0.02/.shipit (revision 13670)
+++ lang/perl/Test-Snippet/tags/release-0.02/.shipit (revision 13670)
@@ -0,0 +1,2 @@
+steps = FindVersion, ChangeVersion, CheckChangeLog, DistTest, Commit, Tag, MakeDist, UploadCPAN
+svk.tagpattern = release-%v
