kokizzu / plv8js

Automatically exported from code.google.com/p/plv8js
Other
0 stars 0 forks source link

New Exception regression test #75

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I would like a test like this added to the regression suite:

CREATE OR REPLACE FUNCTION v8_test_throw() RETURNS float AS
$$ 
throw new Error('Error');
$$
LANGUAGE plv8;

CREATE OR REPLACE FUNCTION v8_test_catch_throw() RETURNS json AS
$$
 try{
   var res = plv8.execute('select * from  v8_test_throw()');
 } catch(e) {
   return {"result": "error"};
 }
$$
language plv8;

SELECT v8_test_catch_throw();

This is a regression test to test for issue 
http://code.google.com/p/plv8js/issues/detail?id=71

I'm not sure if this affects any other platforms besides windows, but would be 
good in place to test. Right now when I test against windows it passes all 
current tests.

On a faulty install, this test will crash the postgres service and on a good 
install -- will just return:

{"result":"error"}

Original issue reported on code.google.com by reg...@arrival3d.com on 13 Jun 2013 at 1:00

GoogleCodeExporter commented 9 years ago
43a4b

Original comment by umi.tan...@gmail.com on 22 Jun 2013 at 9:40