Permalink
Browse files

Clean up data marshalling code since rakudobugs have been fixed; add …

…a test for Mu
  • Loading branch information...
1 parent 2b0aabf commit 4c20d421fcbbe591afa072956086a651905918fa @leto committed Sep 10, 2010
Showing with 8 additions and 9 deletions.
  1. +1 −7 plparrot.c
  2. +7 −2 t/sql/plperl6.sql
View
@@ -576,13 +576,7 @@ plparrot_make_sausage(Parrot_Interp interp, Parrot_PMC pmc, FunctionCallInfo fci
being the return value
*/
return (Datum) 1;
- } else if (PMC_ISA(pmc,"Nil")
- /* XXX: TODO should check for an empty Parcel */
- /* This should only have to check Any, but Rakudo
- has a bug where @_[0].WHAT returns "Proxy" */
- || PMC_ISA(pmc,"Proxy") || PMC_ISA(pmc,"Any")
- )
- {
+ } else if (PMC_ISA(pmc,"Nil") || PMC_ISA(pmc,"Mu")) {
return (Datum) 0;
} else if (PMC_ISA(pmc,"Parcel")) {
elog(ERROR, "CANNOT MAKE Parcel INTO SAUSAGE");
View
@@ -15,12 +15,16 @@ BEGIN;
\i plparrot.sql
-- Plan the tests.
-SELECT plan(28);
+SELECT plan(29);
CREATE OR REPLACE FUNCTION test_void_plperl6() RETURNS void LANGUAGE plperl6 AS $$
{ Nil }
$$;
+CREATE OR REPLACE FUNCTION test_mu() RETURNS void LANGUAGE plperl6 AS $$
+{ Mu }
+$$;
+
CREATE OR REPLACE FUNCTION test_int_plperl6() RETURNS int LANGUAGE plperl6 AS $$
() { 42 }
$$;
@@ -152,7 +156,8 @@ CREATE OR REPLACE FUNCTION test_singlequote_plperl6() RETURNS varchar AS $$
{ 'rakudo*' } $$ LANGUAGE plperl6;
select is(test_int_plperl6(),42,'Return an integer from PL/Perl6');
-select is(test_void_plperl6()::text,''::text,'Return nothing from PL/Perl6');
+select is(test_void_plperl6()::text,''::text,'Return Nil from PL/Perl6');
+select is(test_mu()::text,''::text,'Return Mu from PL/Perl6');
select is(test_float_plperl6(), 5.0::float,'Return a float from PL/Perl6');
select is(test_string_plperl6(), 'rakudo','Return a varchar from PL/Perl6');
select is(test_singlequote_plperl6(), 'rakudo*','Use a single quote in a PL/Perl6 procedure');

0 comments on commit 4c20d42

Please sign in to comment.