Skip to content

Commit

Permalink
Add a test for syntax error handling. This doesn't actually test anyt…
Browse files Browse the repository at this point in the history
…hing, or output tap, because... I don't think anyone knows how exactly syntax error reporting should be handled. Right now it just crashes, which is not what we want.
  • Loading branch information
eggyknap authored and leto committed Apr 15, 2010
1 parent cf6540a commit 3b6e050
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions t/sql/test.sql
Expand Up @@ -96,6 +96,11 @@ CREATE FUNCTION test_int_float(int, float) RETURNS int AS $$
.return(1)
$$ LANGUAGE plparrot;

CREATE FUNCTION test_syntax_error() RETURNS void AS $$
.sub main :anon
syntax error
.end
$$ LANGUAGE plparrot;

select is(test_text_in('cheese'), 'cheese', 'We can pass a text in');
select is(test_text_out('cheese'), 'blue', 'We can return a text');
Expand All @@ -117,6 +122,8 @@ select is(test_void()::text,''::text,'We can return void');
select is(test_float(), 1.0::float ,'We can return a float');
select is(test_float_add(42), 47.0::float ,'We can add to a float and return it');

select test_syntax_error();

-- Finish the tests and clean up.
SELECT * FROM finish();

Expand Down

0 comments on commit 3b6e050

Please sign in to comment.