This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Move autodie from lib to ext
[perl5.git] / lib / CGI / t / user_agent.t
1 # Test the user_agent method. 
2 use lib 't/lib';
3 use Test::More 'no_plan';
4 use CGI;
5
6 my $q = CGI->new; 
7
8 is($q->user_agent, undef, 'user_agent: undef test'); 
9
10 $ENV{HTTP_USER_AGENT} = 'mark';
11 is($q->user_agent, 'mark', 'user_agent: basic test'); 
12 ok($q->user_agent('ma.*'), 'user_agent: positive regex test'); 
13 ok(!$q->user_agent('BOOM.*'), 'user_agent: negative regex test'); 
14
15