r19745 - in /branches/upstream/libtest-expect-perl/current: CHANGES META.yml Makefile.PL lib/Test/Expect.pm

gregoa at users.alioth.debian.org gregoa at users.alioth.debian.org
Fri May 9 12:24:12 UTC 2008


Author: gregoa
Date: Fri May  9 12:24:11 2008
New Revision: 19745

URL: http://svn.debian.org/wsvn/?sc=1&rev=19745
Log:
[svn-upgrade] Integrating new upstream version, libtest-expect-perl (0.31)

Modified:
    branches/upstream/libtest-expect-perl/current/CHANGES
    branches/upstream/libtest-expect-perl/current/META.yml
    branches/upstream/libtest-expect-perl/current/Makefile.PL
    branches/upstream/libtest-expect-perl/current/lib/Test/Expect.pm

Modified: branches/upstream/libtest-expect-perl/current/CHANGES
URL: http://svn.debian.org/wsvn/branches/upstream/libtest-expect-perl/current/CHANGES?rev=19745&op=diff
==============================================================================
--- branches/upstream/libtest-expect-perl/current/CHANGES (original)
+++ branches/upstream/libtest-expect-perl/current/CHANGES Fri May  9 12:24:11 2008
@@ -1,4 +1,8 @@
 Revision history for Perl module Devel::ebug
+
+0.31 Wed May  7 10:15:19 BST 2008
+     - add expect_quit method to close the Expect object
+       (patch by Alex Vandiver)
 
 0.30 Tue Feb 28 21:54:16 GMT 2006
      - added expect_handle to fetch the underlying Expect object

Modified: branches/upstream/libtest-expect-perl/current/META.yml
URL: http://svn.debian.org/wsvn/branches/upstream/libtest-expect-perl/current/META.yml?rev=19745&op=diff
==============================================================================
--- branches/upstream/libtest-expect-perl/current/META.yml (original)
+++ branches/upstream/libtest-expect-perl/current/META.yml Fri May  9 12:24:11 2008
@@ -1,8 +1,23 @@
---- #YAML:1.0
+---
 name: Test-Expect
-version: 0.30
+version: 0.31
 author:
-  - Leon Brocard, C<< <acme at astray.com> >>
+  - 'Leon Brocard, C<< <acme at astray.com> >>'
 abstract: Automated driving and testing of terminal-based programs
 license: perl
-generated_by: Module::Build version 0.2611, without YAML.pm
+resources:
+  license: http://dev.perl.org/licenses/
+requires:
+  Class::Accessor::Chained::Fast: 0
+  Expect::Simple: 0
+  Term::ReadLine: 0
+  Test::Builder: 0
+  Test::More: 0
+provides:
+  Test::Expect:
+    file: lib/Test/Expect.pm
+    version: 0.31
+generated_by: Module::Build version 0.280801
+meta-spec:
+  url: http://module-build.sourceforge.net/META-spec-v1.2.html
+  version: 1.2

Modified: branches/upstream/libtest-expect-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/branches/upstream/libtest-expect-perl/current/Makefile.PL?rev=19745&op=diff
==============================================================================
--- branches/upstream/libtest-expect-perl/current/Makefile.PL (original)
+++ branches/upstream/libtest-expect-perl/current/Makefile.PL Fri May  9 12:24:11 2008
@@ -1,17 +1,18 @@
-# Note: this file was auto-generated by Module::Build::Compat version 0.03
+# Note: this file was auto-generated by Module::Build::Compat version 0.2808_01
 use ExtUtils::MakeMaker;
 WriteMakefile
 (
+          'PL_FILES' => {},
+          'INSTALLDIRS' => 'site',
           'NAME' => 'Test::Expect',
+          'EXE_FILES' => [],
           'VERSION_FROM' => 'lib/Test/Expect.pm',
           'PREREQ_PM' => {
+                           'Test::More' => '0',
                            'Class::Accessor::Chained::Fast' => '0',
-                           'Expect::Simple' => '0',
                            'Term::ReadLine' => '0',
                            'Test::Builder' => '0',
-                           'Test::More' => '0'
-                         },
-          'INSTALLDIRS' => 'site',
-          'PL_FILES' => {}
+                           'Expect::Simple' => '0'
+                         }
         )
 ;

Modified: branches/upstream/libtest-expect-perl/current/lib/Test/Expect.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libtest-expect-perl/current/lib/Test/Expect.pm?rev=19745&op=diff
==============================================================================
--- branches/upstream/libtest-expect-perl/current/lib/Test/Expect.pm (original)
+++ branches/upstream/libtest-expect-perl/current/lib/Test/Expect.pm Fri May  9 12:24:11 2008
@@ -7,15 +7,16 @@
 use Test::Builder;
 use base qw(Class::Accessor::Chained::Fast Exporter);
 __PACKAGE__->mk_accessors(qw(program));
-our $VERSION = "0.30";
-our @EXPORT = qw(
-expect_run
-expect_handle
-expect_is
-expect_like
-expect_send
-expect
-END
+our $VERSION = "0.31";
+our @EXPORT  = qw(
+    expect_run
+    expect_handle
+    expect_is
+    expect_like
+    expect_send
+    expect_quit
+    expect
+    END
 );
 
 my $Test = Test::Builder->new;
@@ -24,67 +25,72 @@
 my $sent;
 
 sub import {
-  my $self = shift;
-  if (@_) {
-    die @_;
-    my $package = caller;
-    $Test->exported_to($package);
-    $Test->plan(@_);
-  };
-  $Test->no_ending(0);
-  $self->export_to_level(1, $self, $_) foreach @EXPORT;
+    my $self = shift;
+    if (@_) {
+        die @_;
+        my $package = caller;
+        $Test->exported_to($package);
+        $Test->plan(@_);
+    }
+    $Test->no_ending(0);
+    $self->export_to_level( 1, $self, $_ ) foreach @EXPORT;
 }
 
 sub expect_run {
-  my(%conf) = @_;
-  $expect = Expect::Simple->new({
-  Cmd => "PERL_RL=\"o=0\" " . $conf{command},
-  Prompt => $conf{prompt},
-  DisconnectCmd => $conf{quit},
-  Verbose => 0,
-  Debug => 0,
-  Timeout => 100
-});
-  die $expect->error if $expect->error;
-  $Test->ok(1, "expect_run");
+    my (%conf) = @_;
+    $expect = Expect::Simple->new(
+        {   Cmd           => "PERL_RL=\"o=0\" " . $conf{command},
+            Prompt        => $conf{prompt},
+            DisconnectCmd => $conf{quit},
+            Verbose       => 0,
+            Debug         => 0,
+            Timeout       => 100
+        }
+    );
+    die $expect->error if $expect->error;
+    $Test->ok( 1, "expect_run" );
 }
 
 sub expect_handle { return $expect->expect_handle(); }
 
 sub before {
-  my $before = $expect->before;
-  $before =~ s/\r//g;
-  $before =~ s/^$sent// if $sent;
-  $before =~ s/^\n+//;
-  $before =~ s/\n+$//;
-  return $before;
+    my $before = $expect->before;
+    $before =~ s/\r//g;
+    $before =~ s/^$sent// if $sent;
+    $before =~ s/^\n+//;
+    $before =~ s/\n+$//;
+    return $before;
 }
 
 sub expect_like {
-  my($like, $comment) = @_;
-  $Test->like(before(), $like, $comment);
+    my ( $like, $comment ) = @_;
+    $Test->like( before(), $like, $comment );
 }
 
 sub expect_is {
-  my($is, $comment) = @_;
-  $Test->is_eq(before(), $is, $comment);
+    my ( $is, $comment ) = @_;
+    $Test->is_eq( before(), $is, $comment );
 }
 
 sub expect_send {
-  my($send, $comment) = @_;
-  $expect->send($send);
-  $sent = $send;
-  $Test->ok(1, $comment);
+    my ( $send, $comment ) = @_;
+    $expect->send($send);
+    $sent = $send;
+    $Test->ok( 1, $comment );
 }
 
 sub expect {
-  my($send, $is, $label) = @_;
-  expect_send($send, $label);
-  expect_is($is, $label);
+    my ( $send, $is, $label ) = @_;
+    expect_send( $send, $label );
+    expect_is( $is, $label );
+}
+
+sub expect_quit {
+    undef $expect;
 }
 
 sub END {
-  undef $expect;
+    expect_quit;
 }
 
 1;
@@ -167,6 +173,10 @@
 
 This returns the L<Expect> object.
 
+=head1 expect_quit
+
+Closes the L<Expect> handle.
+
 =head1 SEE ALSO
 
 L<Expect>, L<Expect::Simple>.




More information about the Pkg-perl-cvs-commits mailing list