"Fossies" - the Fresh Open Source Software Archive

Member "Apache-Session-1.93/t/99moduniqgen.t" (15 Sep 2009, 672 Bytes) of package /linux/www/Apache-Session-1.93.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 use Test::More;
    2 use Test::Exception;
    3 use File::Temp qw[tempdir];
    4 use Cwd qw[getcwd];
    5 
    6 plan tests => 4;
    7 
    8 my $package = 'Apache::Session::Generate::ModUniqueId';
    9 use_ok $package;
   10 
   11 #my $origdir = getcwd;
   12 #my $tempdir = tempdir( DIR => '.', CLEANUP => 1 );
   13 #chdir( $tempdir );
   14 
   15 $ENV{UNIQUE_ID} = '12345678790abcdef';
   16 
   17 my $session = {};
   18 
   19 Apache::Session::Generate::ModUniqueId::generate($session);
   20 
   21 ok exists($session->{data}->{_session_id}), 'session id created';
   22 
   23 ok keys(%{$session->{data}}) == 1, 'just one key in the data hashref';
   24 
   25 is $session->{data}->{_session_id}, $ENV{UNIQUE_ID},
   26    'id matches UNIQUE_ID env param';
   27 
   28 #chdir( $origdir );