summaryrefslogtreecommitdiff
path: root/t/user_agent.t
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2015-06-16 06:44:29 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2015-06-16 06:44:29 +0000
commitf9f3ab3056d94292adb4ab2e1451645bee989769 (patch)
treecc5a62954d359d5aad449420bc7ec259b3edb79e /t/user_agent.t
downloadCGI-tarball-master.tar.gz
Diffstat (limited to 't/user_agent.t')
-rw-r--r--t/user_agent.t14
1 files changed, 14 insertions, 0 deletions
diff --git a/t/user_agent.t b/t/user_agent.t
new file mode 100644
index 0000000..b861afb
--- /dev/null
+++ b/t/user_agent.t
@@ -0,0 +1,14 @@
+# Test the user_agent method.
+use Test::More 'no_plan';
+use CGI;
+
+my $q = CGI->new;
+
+is($q->user_agent, undef, 'user_agent: undef test');
+
+$ENV{HTTP_USER_AGENT} = 'mark';
+is($q->user_agent, 'mark', 'user_agent: basic test');
+ok($q->user_agent('ma.*'), 'user_agent: positive regex test');
+ok(!$q->user_agent('BOOM.*'), 'user_agent: negative regex test');
+
+