File: 03catchsmry.t

package info (click to toggle)
libterm-shell-perl 0.13-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 264 kB
  • sloc: perl: 1,262; makefile: 8
file content (55 lines) | stat: -rw-r--r-- 1,259 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package main;

use strict;
use warnings;

use Test::More;

if ( $^O eq 'MSWin32' )
{
    plan skip_all => "Test gets stuck on Windows - RT #40771";
}
else
{
    plan tests => 1;
}

require Term::Shell;

{

    package Term::Shell::Test;
    use base 'Term::Shell';

    sub summary
    {
        my $self = shift;
        $::called = 1;
        $self->SUPER::summary(@_);
    }
    sub run_fuzz { }
};

my $sh = Term::Shell::Test->new;

{
    $sh->run_help;
};

# TEST
unless ( is( $::called, 1, "catch_smry gets called for unknown methods" ) )
{
    diag "Term::Shell did not call a custom catch_smry handler";
    diag "This is most likely because your version of Term::Shell";
    diag "has a bug. Please upgrade to v0.02 or higher, which";
    diag "should close this bug.";
    diag "If that is no option, patch sub help() in Term/Shell.pm, line 641ff.";
    diag "to:";
    diag '      #my $smry = exists $o->{handlers}{$h}{smry};';
    diag '    #? $o->summary($h);';
    diag '    #: "undocumented";';
    diag '      my $smry = $o->summary($h);';
    diag 'Fixing this is not necessary - you will get no online help';
    diag 'but the shell will otherwise work fine. Help is still';
    diag 'available through ``perldoc WWW::Mechanize::Shell``';
}