summaryrefslogtreecommitdiff
path: root/t/user_agent.t
diff options
context:
space:
mode:
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');
+
+