Message-Id: <rt-3.6.HEAD-10743-
1187176792-1816.44647-75-0@perl.org>
p4raw-id: //depot/perl@31732
t/op/ord.t See if ord works
t/op/or.t See if || works in weird situations
t/op/override.t See if operator overriding works
+t/op/overload_integer.t See if overload::constant for integer works after "use".
t/op/pack.t See if pack and unpack work
t/op/pat.t See if esoteric patterns work
t/op/pos.t See if pos works
--- /dev/null
+#!./perl
+
+use strict;
+use warnings;
+
+print "1..2\n";
+
+package Foo;
+
+use overload;
+
+sub import
+{
+ overload::constant 'integer' => sub { return shift; };
+}
+
+package main;
+
+BEGIN { $INC{'Foo.pm'} = "/lib/Foo.pm" }
+
+use Foo;
+
+my $result = eval "5+6";
+
+my $error = $@;
+
+my $label = "No exception was thrown with an overload::constant 'integer' inside an eval.";
+# TEST
+if ($error eq "")
+{
+ print "ok 1 - $label\n"
+}
+else
+{
+ print "not ok 1 - $label\n";
+ print "# Error is $error\n";
+}
+
+$label = "Correct solution";
+
+if (!defined($result))
+{
+ $result = "";
+}
+# TEST
+if ($result eq 11)
+{
+ print "ok 2 - $label\n";
+}
+else
+{
+ print "not ok 2 - $label\n";
+ print "# Result is $result\n";
+}
+