Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 30 lines (24 sloc) 0.76 kb
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
use strict;
use warnings;
use CGI::Header;
use Test::More tests => 13;

my %adaptee;
tie my %adapter, 'CGI::Header', \%adaptee;

%adaptee = ();
is $adapter{Window_Target}, undef;
ok !exists $adapter{Window_Target};
is delete $adapter{Window_Target}, undef;
is_deeply \%adaptee, {};

%adaptee = ( -target => q{} );
is $adapter{Window_Target}, q{};
ok exists $adapter{Window_Target};
is delete $adapter{Window_Target}, q{};
is_deeply \%adaptee, {};

%adaptee = ( -target => 'ResultsWindow' );
is $adapter{Window_Target}, 'ResultsWindow';
ok exists $adapter{Window_Target};
is delete $adapter{Window_Target}, 'ResultsWindow';
is_deeply \%adaptee, {};

%adaptee = ();
$adapter{Window_Target} = 'ResultsWindow';
is_deeply \%adaptee, { -target => 'ResultsWindow' };
Something went wrong with that request. Please try again.