[Bps-public-commit] r12627 - in pie/branches/named-params: lib/PIE

clkao at bestpractical.com clkao at bestpractical.com
Fri May 23 01:19:44 EDT 2008


Author: clkao
Date: Fri May 23 01:19:43 2008
New Revision: 12627

Modified:
   pie/branches/named-params/lib/PIE/Builder.pm
   pie/branches/named-params/t/01basic.t

Log:
call defun properly.


Modified: pie/branches/named-params/lib/PIE/Builder.pm
==============================================================================
--- pie/branches/named-params/lib/PIE/Builder.pm	(original)
+++ pie/branches/named-params/lib/PIE/Builder.pm	Fri May 23 01:19:43 2008
@@ -15,7 +15,7 @@
         $class->new( map { $_ => $self->build_expression( $args->{$_} ) } keys %$args );
     }
     else {
-        PIE::Expression->new( name => $name, args => $args || {} );
+        PIE::Expression->new( name => $name, args => { map { $_ => $self->build_expression( $args->{$_} ) } keys %$args } );
     }
 }
 

Modified: pie/branches/named-params/t/01basic.t
==============================================================================
--- pie/branches/named-params/t/01basic.t	(original)
+++ pie/branches/named-params/t/01basic.t	Fri May 23 01:19:43 2008
@@ -115,21 +115,19 @@
 
 $eval10->apply_script_named_args(
     $builder->defun(
-        ops  => [ {name =>'IfThen'} ],
-        args => {
-            'if_true'   => PIE::Expression::String->new( value => 'hate' ),
-            'if_false'  => PIE::Expression::String->new( value => 'love' ),
-            'condition' => {
-                ops  => [ {name =>'match-regexp'} ],
+        ops => [ { name => 'IfThen',
                 args => {
-                    regex =>
-                        PIE::Expression::String->new( value => 'software' ),
-                    'tested-string' =>
-                        PIE::Expression::String->new( value => 'foo' )
-                }
-            },
-        }
-    )
+                    'if_true'   => 'hate',
+                    'if_false'  => 'love',
+                    'condition' => {
+                        name => 'match-regexp',
+                        args => {
+                            regex           => 'software',
+                            'tested-string' => 'foo',
+                            } } } } ],
+        args => {},
+    ),
+    {},
 );
 ok( $eval10->result->success );
 is( $eval10->result->value, ' love ' );



More information about the Bps-public-commit mailing list