Put back accidentally-deleted quote_literal() regression tests.

This commit is contained in:
Robert Haas 2010-11-21 20:46:54 -05:00
parent 506070be34
commit 95dacf8593
2 changed files with 29 additions and 2 deletions

View File

@ -52,7 +52,7 @@ LINE 1: select 3 || 4.0;
^ ^
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts. HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
/* /*
* string functions * various string functions
*/ */
select concat('one'); select concat('one');
concat concat
@ -118,6 +118,27 @@ select i, left('ahoj', i), right('ahoj', i) from generate_series(-5, 5) t(i) ord
5 | ahoj | ahoj 5 | ahoj | ahoj
(11 rows) (11 rows)
select quote_literal('');
quote_literal
---------------
''
(1 row)
select quote_literal('abc''');
quote_literal
---------------
'abc'''
(1 row)
select quote_literal(e'\\');
quote_literal
---------------
E'\\'
(1 row)
/*
* format
*/
select format(NULL); select format(NULL);
format format
-------- --------

View File

@ -30,7 +30,7 @@ select 'four: ' || 2+2;
select 3 || 4.0; select 3 || 4.0;
/* /*
* string functions * various string functions
*/ */
select concat('one'); select concat('one');
select concat(1,2,3,'hello',true, false, to_date('20100309','YYYYMMDD')); select concat(1,2,3,'hello',true, false, to_date('20100309','YYYYMMDD'));
@ -41,7 +41,13 @@ select concat_ws('',10,20,null,30);
select concat_ws(NULL,10,20,null,30) is null; select concat_ws(NULL,10,20,null,30) is null;
select reverse('abcde'); select reverse('abcde');
select i, left('ahoj', i), right('ahoj', i) from generate_series(-5, 5) t(i) order by i; select i, left('ahoj', i), right('ahoj', i) from generate_series(-5, 5) t(i) order by i;
select quote_literal('');
select quote_literal('abc''');
select quote_literal(e'\\');
/*
* format
*/
select format(NULL); select format(NULL);
select format('Hello'); select format('Hello');
select format('Hello %s', 'World'); select format('Hello %s', 'World');