Permalink
Browse files

added more tests for "array_map_op set_quote_json_str/set_quote_sql_s…

…tr/set_quote_pgsql_str".
  • Loading branch information...
1 parent 0932573 commit 2763e43a0bac278fd008eebff6addd424cf99e47 @agentzh agentzh committed Aug 18, 2010
Showing with 31 additions and 1 deletion.
  1. +31 −1 test/t/sanity.t
View
@@ -1,4 +1,4 @@
-# vi:filetype=perl
+# vi:filetype=
use lib 'lib';
use Test::Nginx::Socket;
@@ -339,3 +339,33 @@ GET /foo?names=bob,marry,nomas
--- response_body
[]
+
+
+=== TEST 23: map op (copy) on set_quote_pgsql_str
+--- config
+ location /foo {
+ array_split ',' $arg_names to=$names;
+ array_map_op set_quote_pgsql_str $names to=$list;
+ array_join '+' $list to=$res;
+ echo $res;
+ }
+--- request
+GET /foo?names=bob,marry,nomas
+--- response_body
+E'bob'+E'marry'+E'nomas'
+
+
+
+=== TEST 24: map op (copy) on set_quote_json_str
+--- config
+ location /foo {
+ array_split ',' $arg_names to=$names;
+ array_map_op set_quote_json_str $names to=$list;
+ array_join '+' $list to=$res;
+ echo $res;
+ }
+--- request
+GET /foo?names=bob,marry,nomas
+--- response_body
+"bob"+"marry"+"nomas"
+

0 comments on commit 2763e43

Please sign in to comment.