[Bps-public-commit] r13523 - in Shipwright/trunk: t

sunnavy at bestpractical.com sunnavy at bestpractical.com
Sat Jun 21 03:05:42 EDT 2008


Author: sunnavy
Date: Sat Jun 21 03:05:42 2008
New Revision: 13523

Modified:
   Shipwright/trunk/   (props changed)
   Shipwright/trunk/t/71.script_cmds.t

Log:
 r13609 at sunnavys-mb:  sunnavy | 2008-06-21 02:43:18 +0800
 added flags cmd tests


Modified: Shipwright/trunk/t/71.script_cmds.t
==============================================================================
--- Shipwright/trunk/t/71.script_cmds.t	(original)
+++ Shipwright/trunk/t/71.script_cmds.t	Sat Jun 21 03:05:42 2008
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 40;
+use Test::More tests => 64;
 
 use Shipwright;
 use Shipwright::Test;
@@ -157,16 +157,89 @@
         [
             [ 'list', '--name', 'foo' ], qr/foo doesn't exist/, "foo is deleted"
         ],
+
+        # import dists/dir_configure
+        [
+            [ 'import', 'dir:t/dists/dir_configure', '--version', 3.14 ],
+            qr/imported with success/,
+            'imported dists_dir_configure',
+        ],
+        [
+            [ 'ls', '--name', 'dir_configure' ],
+
+            qr{dir_configure:\s+ 
+              version:\s+3\.14\s+
+              from:\s+ directory:t/dists/dir_configure}mx,
+            'list dir_configure, --version arg is works too',
+        ],
+
+        # import dists/tgz_build.tar.gz
+        [
+            [ 'import', 'file:t/dists/tgz_build.tar.gz', '--version', 2.72, 
+        '--follow', 0 ],
+            qr/imported with success/,
+            'imported tgz_build',
+        ],
+        [
+            [ 'ls', '--name', 'tgz_build' ],
+            qr{tgz_build:\s+ 
+              version:\s+2\.72\s+
+              from:\s+ file:t/dists/tgz_build.tar.gz}mx,
+            'list tgz_build, --version arg works too',
+        ],
+
+        # import dists/tbz_make.tar.bz
+        [
+            [ 'import', 'file:t/dists/tbz_make.tar.bz2', '--follow', 0 ],
+            qr/imported with success/,
+            'imported tbz_make',
+        ],
+        [
+            [ 'ls', '--name', 'tbz_make' ],
+            qr{tbz_make:\s+ 
+              version:\s+
+              from:\s+ file:t/dists/tbz_make.tar.bz2}mx,
+            'list tgz_make',
+        ],
+
+        # set flags dir_configure to 'configure'
+        [
+            [ 'flags', '--name', 'dir_configure', ],
+            qr/flags of dir_configure is \*nothing\*/,
+            'default is no flags',
+        ],
+        [
+            [ 'flags', '--name', 'dir_configure', '--set', 'configure,foo', ],
+qr/set flags with success\s+flags of dir_configure is configure, foo/,
+            'set flags with success',
+        ],
+        [
+            [ 'flags', 'dir_configure', '--add', 'bar', ],
+qr/set flags with success\s+flags of dir_configure is bar, configure, foo/,
+            'add flags to dir_configure',
+        ],
+        [
+            [ 'flags', 'dir_configure', '--del', 'foo,bar', ],
+            qr/set flags with success\s+flags of dir_configure is configure/,
+            'delete flags to dir_configure',
+        ],
+        [
+            [ 'flags', 'tgz_build', '--set', 'build' ],
+            qr/set flags with success\s+flags of tgz_build is build/,
+            'set flags to tgz_build',
+        ],
+        [
+            [ 'flags', 'man1', '--set', 'build', '--mandatary' ],
+qr/set mandatary flags with success\s+mandatary flags of man1 is build/,
+            'set mandatary flags to man1',
+        ],
     );
 
     for my $item (@cmds) {
-        my $cmd = shift @{$item->[0]};
+        my $cmd = shift @{ $item->[0] };
         test_cmd(
             $repo,
-            [
-                $sw, $cmd, '-r', $repo,
-                @{ $item->[0] },
-            ],
+            [ $sw, $cmd, '-r', $repo, @{ $item->[0] }, ],
             @$item[ 1 .. $#$item ],
         );
     }



More information about the Bps-public-commit mailing list