[svk-commit] r2817 - trunk/t/bm
nobody at bestpractical.com
nobody at bestpractical.com
Wed May 7 05:15:21 EDT 2008
Author: clsung
Date: Wed May 7 05:15:10 2008
New Revision: 2817
Added:
trunk/t/bm/checkout.t
Log:
- add test for --checkout
- ref: http://task.hm/E9Y9/
Added: trunk/t/bm/checkout.t
==============================================================================
--- (empty file)
+++ trunk/t/bm/checkout.t Wed May 7 05:15:10 2008
@@ -0,0 +1,52 @@
+#!/usr/bin/perl -w
+use strict;
+use Test::More tests => 7;
+use SVK::Test;
+use File::Path;
+
+my ($xd, $svk) = build_test('test');
+our $output;
+$svk->mkdir(-m => 'trunk', '/test/trunk');
+$svk->mkdir(-m => 'trunk', '/test/branches');
+$svk->mkdir(-m => 'trunk', '/test/tags');
+my $tree = create_basic_tree($xd, '/test/trunk');
+
+my $depot = $xd->find_depot('test');
+my $uri = uri($depot->repospath);
+
+$svk->mirror('//mirror/MyProject', $uri);
+$svk->sync('//mirror/MyProject');
+
+my ($copath, $corpath) = get_copath ('proj_co');
+
+mkdir($copath);
+mkdir($copath."/A");
+
+$svk->br('--create', 'feature/foo', '//mirror/MyProject');
+
+is_output ($svk, 'branch', ['--list', '//mirror/MyProject'],
+ ['feature/foo']);
+
+is_output ($svk, 'branch', ['--checkout', 'feature/foo'],
+ [qr/path \S+ is not a checkout path./]);
+
+chdir($copath."/A");
+is_output_like ($svk, 'branch', ['--checkout', 'feature/foo', '//mirror/MyProject'],
+ qr'Syncing \S+ in \S+A/feature/foo to \d.+');
+
+is_output_like ($svk, 'branch', ['--checkout', 'feature/foo', '//mirror/MyProject', '../B/'],
+ qr'Syncing \S+ in \S+B to \d.+');
+
+chdir('../B');
+
+is_output_like ($svk, 'info',[],
+ qr'Depot Path: //mirror/MyProject/branches/feature/foo');
+
+# swap the order, and co the trunk
+is_output_like ($svk, 'branch', ['--checkout', 'trunk', '../C', '//mirror/MyProject'],
+ qr'Syncing \S+ in \S+C to \d.+');
+
+chdir('../C');
+
+is_output_like ($svk, 'info',[],
+ qr'Depot Path: //mirror/MyProject/trunk');
More information about the svk-commit
mailing list