File: mode_param_overwritten.t

package info (click to toggle)
libcgi-application-perl 4.61-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 708 kB
  • sloc: perl: 1,397; sh: 38; makefile: 7
file content (20 lines) | stat: -rw-r--r-- 377 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# This is for a bug introduced in 4.02 where mode_param
# didn't work if it was set in a sub-class. 

package My::CA;
use base 'CGI::Application';

sub cgiapp_init {
    my $self = shift;
    $self->mode_param('mine');
}


package main;
use Test::More tests => 1;

{
    my $app = My::CA->new();
    is( $app->mode_param, 'mine', "setting mode_param in a sub-class works");
}