allow value scalarref, refactor
[scpubgit/DKit.git] / t / dot_ssh.t
index 6c3bc9d..6e0a1c6 100644 (file)
@@ -53,29 +53,23 @@ my $solver = DX::Solver->new(
 
 $solver->add_rule(@$_) for (
   [ path_status => [ qw(PS) ],
-    [ member_of => 'PS', [ value => 'path_status' ] ] ],
+    [ member_of => 'PS', \'path_status' ] ],
   [ path => [ qw(PS P) ],
-    [ prop => 'PS', [ value => 'path' ], 'P' ] ],
-  [ mode => [ qw(PS M) ],
+    [ prop => 'PS', \'path', 'P' ] ],
+  [ info_prop => [ qw(PS N V) ],
     [ exists => [ qw(PSI) ],
-      [ prop => 'PS', [ value => 'info' ], 'PSI' ],
-      [ prop => 'PSI', [ value => 'mode' ], 'M' ] ] ],
+      [ prop => 'PS', \'info', 'PSI' ],
+      [ prop => 'PSI', 'N', 'V' ] ] ],
+  [ mode => [ qw(PS M) ],
+    [ info_prop => 'PS', \'mode', 'M' ] ],
   [ exists_path => [ qw(PS) ],
-    [ exists => [ qw(PSI) ],
-      [ prop => 'PS', [ value => 'info' ], 'PSI' ],
-      [ prop => 'PSI', [ value => 'is_directory' ], [ value => 1 ] ] ] ],
+    [ info_prop => 'PS', \'is_directory', \1 ] ],
   [ exists_path => [ qw(PS) ],
-    [ exists => [ qw(PSI) ],
-      [ prop => 'PS', [ value => 'info' ], 'PSI' ],
-      [ prop => 'PSI', [ value => 'is_file' ], [ value => 1 ] ] ] ],
+    [ info_prop => 'PS', \'is_file', \1 ] ],
   [ is_directory => [ qw(PS) ],
-    [ exists => [ qw(PSI) ],
-      [ prop => 'PS', [ value => 'info' ], 'PSI' ],
-      [ prop => 'PSI', [ value => 'is_directory' ], [ value => 1 ] ] ] ],
+    [ info_prop => 'PS', \'is_directory', \1 ] ],
   [ is_file => [ qw(PS) ],
-    [ exists => [ qw(PSI) ],
-      [ prop => 'PS', [ value => 'info' ], 'PSI' ],
-      [ prop => 'PSI', [ value => 'is_file' ], [ value => 1 ] ] ] ],
+    [ info_prop => 'PS', \'is_file', \1 ] ],
 );
 
 %path_status = %protos;