Showing 1 changed files with 14 additions and 15 deletions
+14 -15
t/basic.t
... ...
@@ -2460,22 +2460,21 @@ $model->method(foo => sub { shift->select(@_) });
2460 2460
 is_deeply($model->foo->one, {key1 => 1, key3 => 3});
2461 2461
 
2462 2462
 test 'merge_param';
2463
-{
2464
-    my $dbi = DBIx::Custom->new;
2465
-    my $param1 = {key1 => 1, key2 => 2, key3 => 3};
2466
-    my $param2 = {key1 => 1, key2 => 2};
2467
-    my $param3 = {key1 => 1};
2468
-    my $param = $dbi->merge_param($param1, $param2, $param3);
2469
-    is_deeply($param, {key1 => [1, 1, 1], key2 => [2, 2], key3 => 3});
2470
-}
2463
+$dbi = DBIx::Custom->new;
2464
+$params = [
2465
+    {key1 => 1, key2 => 2, key3 => 3},
2466
+    {key1 => 1, key2 => 2},
2467
+    {key1 => 1}
2468
+];
2469
+$param = $dbi->merge_param($params->[0], $params->[1], $params->[2]);
2470
+is_deeply($param, {key1 => [1, 1, 1], key2 => [2, 2], key3 => 3});
2471 2471
 
2472
-{
2473
-    my $dbi = DBIx::Custom->new;
2474
-    my $param1 = {key1 => [1, 2], key2 => 1, key3 => [1, 2]};
2475
-    my $param2 = {key1 => [3, 4], key2 => [2, 3], key3 => 3};
2476
-    my $param = $dbi->merge_param($param1, $param2);
2477
-    is_deeply($param, {key1 => [1, 2, 3, 4], key2 => [1, 2, 3], key3 => [1, 2, 3]});
2478
-}
2472
+$params = [
2473
+    {key1 => [1, 2], key2 => 1, key3 => [1, 2]},
2474
+    {key1 => [3, 4], key2 => [2, 3], key3 => 3}
2475
+];
2476
+$param = $dbi->merge_param($params->[0], $params->[1]);
2477
+is_deeply($param, {key1 => [1, 2, 3, 4], key2 => [1, 2, 3], key3 => [1, 2, 3]});
2479 2478
 
2480 2479
 test 'select() param option';
2481 2480
 $dbi = DBIx::Custom->connect(%memory);