summaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2011-07-07 20:21:34 -0500
committerJesse Luehrs <doy@tozt.net>2011-07-07 20:21:34 -0500
commit5649f766a3f28cf9368305072b3351733d675e56 (patch)
tree0ede895451d51e5b9d615c2ee07380b0198470ad /t
parentc17bd97635464c13298b177797da2fb3d02974bc (diff)
downloadsmartmatch-engine-rjbs-5649f766a3f28cf9368305072b3351733d675e56.tar.gz
smartmatch-engine-rjbs-5649f766a3f28cf9368305072b3351733d675e56.zip
make the error line up with the one used in core
Diffstat (limited to 't')
-rw-r--r--t/error.t26
1 files changed, 26 insertions, 0 deletions
diff --git a/t/error.t b/t/error.t
new file mode 100644
index 0000000..10d69be
--- /dev/null
+++ b/t/error.t
@@ -0,0 +1,26 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use Test::More;
+
+my $foo = bless {};
+my $bar = bless {};
+
+eval '$foo ~~ $bar';
+my $core_error = $@;
+$core_error =~ s/\d+/XXX/g;
+(my $short_core_error = $core_error) =~ s/ at .* line .*//;
+
+{
+ use smartmatch 'core';
+ eval '$foo ~~ $bar';
+ my $engine_error = $@;
+ $engine_error =~ s/\d+/XXX/g;
+ (my $short_engine_error = $engine_error) =~ s/ at .* line .*//;
+ is($short_engine_error, $short_core_error);
+ { local $TODO = "Carp is dumb";
+ is($engine_error, $core_error);
+ }
+}
+
+done_testing;