[svk-commit] r3086 - trunk/t/bm

nobody at bestpractical.com nobody at bestpractical.com
Wed Sep 10 10:58:42 EDT 2008


Author: clsung
Date: Wed Sep 10 10:58:36 2008
New Revision: 3086

Added:
   trunk/t/bm/list-projects.t
   trunk/t/bm/remove-via-project.t

Log:
- add two tests for recent commits
  - http://task.hm/GVQ2 and 
  - http://task.hm/GVQ3

Added: trunk/t/bm/list-projects.t
==============================================================================
--- (empty file)
+++ trunk/t/bm/list-projects.t	Wed Sep 10 10:58:36 2008
@@ -0,0 +1,27 @@
+#!/usr/bin/perl -w
+use strict;
+use SVK::Test;
+plan tests => 2;
+our $output;
+
+my ($xd, $svk) = build_test('test');
+
+$svk->mkdir('-p', -m => 'trunk in project B', '/test/projectB/trunk');
+$svk->mkdir(-m => 'branches in project B', '/test/projectB/branches');
+$svk->mkdir(-m => 'tags in project B', '/test/projectB/tags');
+my $tree = create_basic_tree($xd, '/test/');
+$tree = create_basic_tree($xd, '/test/projectB/trunk');
+
+my $depot = $xd->find_depot('test');
+my $uri = uri($depot->repospath);
+
+my ($copath, $corpath) = get_copath('list-projects');
+
+$svk->mirror('//mirror/nomeans', $uri);
+$svk->sync('//mirror/nomeans');
+
+$answer = ['','','',''];
+is_output_like ($svk, 'branch', ['--setup', '//mirror/nomeans/projectB'],
+    qr/Project detected in specified path./);
+is_output ($svk, 'branch', ['--list-projects'],
+    ['projectB (depot: )']);

Added: trunk/t/bm/remove-via-project.t
==============================================================================
--- (empty file)
+++ trunk/t/bm/remove-via-project.t	Wed Sep 10 10:58:36 2008
@@ -0,0 +1,45 @@
+#!/usr/bin/perl -w
+use strict;
+use SVK::Test;
+plan tests => 4;
+our $output;
+
+my ($xd, $svk) = build_test('test');
+
+$svk->mkdir('-p', -m => 'trunk in project B', '/test/projectB/trunk');
+$svk->mkdir(-m => 'branches in project B', '/test/projectB/branches');
+$svk->mkdir(-m => 'tags in project B', '/test/projectB/tags');
+my $tree = create_basic_tree($xd, '/test/');
+$tree = create_basic_tree($xd, '/test/projectB/trunk');
+
+my $depot = $xd->find_depot('test');
+my $uri = uri($depot->repospath);
+
+my ($copath, $corpath) = get_copath('remove-via-project');
+
+$svk->mirror('//mirror/nomeans', $uri);
+$svk->sync('//mirror/nomeans');
+
+$svk->checkout('//mirror/nomeans',$copath);
+
+chdir($copath);
+
+$answer = ['','','',''];
+is_output_like ($svk, 'branch', ['--setup', '//mirror/nomeans/projectB'],
+    qr/Project detected in specified path./);
+
+$svk->br('--create','Foo','--project','projectB');
+$svk->br('--create','Bar','--project','projectB');
+is_output ($svk, 'branch', ['--list', '--project', 'projectB'],
+    ['Bar','Foo'],
+    '"br --list --project projectB" after create branches Foo and Bar');
+$svk->br('--remove','Foo','--project','projectB');
+is_output ($svk, 'branch', ['--list', '--project', 'projectB'],
+    ['Bar'],
+    '"br --list --project projectB" after remove Foo');
+chdir('..'); # so not in a wc anymore
+# for http://task.hm/GVQ3
+$svk->br('--remove','Bar','--project','projectB');
+is_output ($svk, 'branch', ['--list', '--project', 'projectB'],
+    [],
+    '"br --list --project projectB" after chdir to non-wc and remove Bar');


More information about the svk-commit mailing list