summaryrefslogtreecommitdiff
path: root/t/num_eq.t
diff options
context:
space:
mode:
Diffstat (limited to 't/num_eq.t')
-rw-r--r--t/num_eq.t16
1 files changed, 16 insertions, 0 deletions
diff --git a/t/num_eq.t b/t/num_eq.t
new file mode 100644
index 0000000..066d84c
--- /dev/null
+++ b/t/num_eq.t
@@ -0,0 +1,16 @@
+# Test URI's overloading of numeric comparison for checking object
+# equality
+
+use strict;
+use warnings;
+use Test::More 'no_plan';
+
+use URI;
+
+my $uri1 = URI->new("http://foo.com");
+my $uri2 = URI->new("http://foo.com");
+
+# cmp_ok() has a bug/misfeature where it strips overloading
+# before doing the comparison. So use a regular ok().
+ok $uri1 == $uri1, "==";
+ok $uri1 != $uri2, "!=";