Permalink
Browse files

Add test for returning Regex object from PL/Perl6; coredump at same p…

…lace as exception branch
  • Loading branch information...
1 parent 767e473 commit 49dbd6c58d51b9286b06366782487871d24cd90c @leto committed Sep 10, 2010
Showing with 8 additions and 0 deletions.
  1. +3 −0 plparrot.c
  2. +5 −0 t/sql/plperl6.sql
View
@@ -580,6 +580,9 @@ plparrot_make_sausage(Parrot_Interp interp, Parrot_PMC pmc, FunctionCallInfo fci
return (Datum) 0;
} else if (PMC_ISA(pmc,"Parcel")) {
elog(ERROR, "CANNOT MAKE Parcel INTO SAUSAGE");
+ } else if (PMC_ISA(pmc,"Regex")) {
+ /* TODO: This should return the Regex.perl */
+ return (Datum) 0;
} else {
elog(ERROR,"CANNOT MAKE SAUSAGE");
}
View
@@ -29,6 +29,10 @@ CREATE OR REPLACE FUNCTION test_return_failure() RETURNS void LANGUAGE plperl6 A
{ Failure }
$$;
+CREATE OR REPLACE FUNCTION test_return_regex() RETURNS text LANGUAGE plperl6 AS $$
+{ /42/ }
+$$;
+
CREATE OR REPLACE FUNCTION test_int_plperl6() RETURNS int LANGUAGE plperl6 AS $$
() { 42 }
$$;
@@ -201,6 +205,7 @@ select is(test_global_grammar(''), 0, 'empty string should not parse in the glob
SELECT language_is_trusted( 'plperl6', 'PL/Perl6 should be trusted' );
select is(test_return_failure()::text,'', 'Return Failure from PL/Perl6');
+select is(test_return_regex()::text,'/42/', 'Return Regex from PL/Perl6');
-- Finish the tests and clean up.
SELECT * FROM finish();

0 comments on commit 49dbd6c

Please sign in to comment.