diff options
author | Jesse Luehrs <doy@tozt.net> | 2011-07-08 03:13:56 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2011-07-08 03:13:56 -0500 |
commit | 8b0a8e232dc4082660ea8daef713e88b9295b2be (patch) | |
tree | 4326e6c6ea2cf306fa317680535e9301837f5aea /t/error_pp.t | |
parent | 1a0c3c3a02da09abc11bbad291d09a41c1850d1d (diff) | |
download | smartmatch-engine-core-8b0a8e232dc4082660ea8daef713e88b9295b2be.tar.gz smartmatch-engine-core-8b0a8e232dc4082660ea8daef713e88b9295b2be.zip |
allow optionally using the pure-perl implementation
Diffstat (limited to 't/error_pp.t')
-rw-r--r-- | t/error_pp.t | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/t/error_pp.t b/t/error_pp.t new file mode 100644 index 0000000..954aef5 --- /dev/null +++ b/t/error_pp.t @@ -0,0 +1,28 @@ +#!/usr/bin/env perl +use strict; +use warnings; +use Test::More; + +BEGIN { $smartmatch::engine::core::USE_PP = 1 } + +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; |