Format PL/Python module contents test vertically
authorPeter Eisentraut <peter_e@gmx.net>
Wed, 19 Oct 2016 16:00:00 +0000 (12:00 -0400)
committerPeter Eisentraut <peter_e@gmx.net>
Thu, 27 Oct 2016 19:41:29 +0000 (15:41 -0400)
It makes it readable again and makes merges more manageable.

src/pl/plpython/expected/plpython_test.out
src/pl/plpython/sql/plpython_test.sql

index adb82a89d604fc29e11501116fa7fe31e4b7f198..847e4cc412e72dfa86952f19238b70bb081a1bc6 100644 (file)
@@ -36,17 +36,34 @@ select "Argument test #1"(users, fname, lname) from users where lname = 'doe' or
 (3 rows)
 
 -- check module contents
-CREATE FUNCTION module_contents() RETURNS text AS
+CREATE FUNCTION module_contents() RETURNS SETOF text AS
 $$
 contents = list(filter(lambda x: not x.startswith("__"), dir(plpy)))
 contents.sort()
-return ", ".join(contents)
+return contents
 $$ LANGUAGE plpythonu;
 select module_contents();
-                                                                               module_contents                                                                                
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- Error, Fatal, SPIError, cursor, debug, error, execute, fatal, info, log, notice, prepare, quote_ident, quote_literal, quote_nullable, spiexceptions, subtransaction, warning
-(1 row)
+ module_contents 
+-----------------
+ Error
+ Fatal
+ SPIError
+ cursor
+ debug
+ error
+ execute
+ fatal
+ info
+ log
+ notice
+ prepare
+ quote_ident
+ quote_literal
+ quote_nullable
+ spiexceptions
+ subtransaction
+ warning
+(18 rows)
 
 CREATE FUNCTION elog_test_basic() RETURNS void
 AS $$
index fa3c465ef86b79fe6bc16718406d5ff73182bb89..5f1be9c94a863862794ebc8a39f673b14af9b9ec 100644 (file)
@@ -27,11 +27,11 @@ select "Argument test #1"(users, fname, lname) from users where lname = 'doe' or
 
 
 -- check module contents
-CREATE FUNCTION module_contents() RETURNS text AS
+CREATE FUNCTION module_contents() RETURNS SETOF text AS
 $$
 contents = list(filter(lambda x: not x.startswith("__"), dir(plpy)))
 contents.sort()
-return ", ".join(contents)
+return contents
 $$ LANGUAGE plpythonu;
 
 select module_contents();