[svk-commit] r2351 - trunk/t

nobody at bestpractical.com nobody at bestpractical.com
Wed Mar 21 13:12:18 EDT 2007


Author: stig
Date: Wed Mar 21 13:12:16 2007
New Revision: 2351

Modified:
   trunk/t/07smerge-rename3.t

Log:
more tests

Modified: trunk/t/07smerge-rename3.t
==============================================================================
--- trunk/t/07smerge-rename3.t	(original)
+++ trunk/t/07smerge-rename3.t	Wed Mar 21 13:12:16 2007
@@ -4,7 +4,8 @@
 # Tests that smerge handles updates after renames have been made
 #
 
-use Test::More tests => 4;
+use Test::More tests => 11;
+use Test::Exception;
 use strict;
 use File::Path;
 use Cwd;
@@ -45,8 +46,13 @@
 $svk->ci(-m => "test 2");
 
 # Merge changes w/rename from trunk to branch
-$svk->smerge('//trunk', '//branches/newbranch', '--track-rename', '-m', 'merge 1');
-warn $output;
+is_output ($svk, 'smerge', ['//trunk', '//branches/newbranch', '--track-rename', '-m', 'merge 1'], [
+    'Auto-merging (2, 6) /trunk to /branches/newbranch (base /trunk:2).',
+    'Collecting renames, this might take a while.',
+    'U   module/test.txt - module2/test.txt',
+    "New merge ticket: $uuid:/trunk:6",
+    'Committed revision 7.',
+]);
 
 # Update the branch
 chdir($co_branch_path);
@@ -58,24 +64,81 @@
 overwrite_file('module/test.txt', '3');
 $svk->ci(-m => "test 3");
 
+$TODO = "--track-rename doesn't pick up renames on subsequent merge";
+
 # Merge changes w/rename from trunk to branch
-$svk->smerge('//trunk', '//branches/newbranch', '--track-rename', '-m', 'merge 2');
+is_output ($svk, 'smerge', ['//trunk', '//branches/newbranch', '--track-rename', '-m', 'merge 2'], [
+    'Auto-merging (6, 8) /trunk to /branches/newbranch (base /trunk:6).',
+    'Collecting renames, this might take a while.',
+    'U   module/test.txt - module2/test.txt',
+    "New merge ticket: $uuid:/trunk:8",
+    'Committed revision 9.',
+]);
 
 # Update the branch
 chdir($co_branch_path);
 $svk->update();
-{ local $TODO = 'should merge in a second time too';
 is_file_content('module2/test.txt', '3');
-}
 
 overwrite_file('module2/test.txt', '4');
 $svk->ci(-m => "test 4");
 
 # Merge changes w/rename from trunk to branch
-$svk->smerge('//branches/newbranch', '//trunk', '--track-rename', '-m', 'merge back');
+# NOTE: This expected output might not be completely correct!
+is_output ($svk, 'smerge', ['//branches/newbranch', '//trunk', '--track-rename', '-m', 'merge back'], [
+    'Auto-merging (0, 9) /branches/newbranch to /trunk (base /trunk:6).',
+    'Collecting renames, this might take a while.',
+    'A + module2',
+    'U   module2/test.txt',
+    'D   module',
+    "New merge ticket: $uuid:/trunk:9",
+    'Committed revision 9.',
+]);
+
+chdir($co_trunk_path);
+$svk->update();
+lives_and {
+is_file_content('module2/test.txt', '4');
+}
+
+
+
+# adding a new dir on trunk
+$svk->mkdir('foo');
+overwrite_file('foo/test.txt', 'a');
+$svk->add('foo/test.txt');
+$svk->ci(-m => "new module added");
+
+# Merge changes w/rename from trunk to branch
+is_output ($svk, 'smerge', ['//trunk', '//branches/newbranch', '--track-rename', '-m', 'merge 3'], [
+    'Auto-merging (6, 10) /trunk to /branches/newbranch (base /trunk:6).',
+    'Collecting renames, this might take a while.',
+    'A   foo',
+    'A   foo/test.txt',
+    "New merge ticket: $uuid:/trunk:10",
+    'Committed revision 11.',
+]);
+
+chdir($co_branch_path);
+$svk->update();
+is_file_content('foo/test.txt', 'a');
+
+$svk->move('foo', 'bar');
+overwrite_file('bar/test.txt', 'b');
+$svk->ci(-m => "test 6 - renamed and changed");
+
+is_output ($svk, 'smerge', ['//branches/newbranch', '//trunk', '--track-rename', '-m', 'merge back'], [
+    'Auto-merging (0, 12) /branches/newbranch to /trunk (base /trunk:10).',
+    'Collecting renames, this might take a while.',
+    'A   bar',
+    'A   bar/test.txt',
+    'D   foo',
+    "New merge ticket: $uuid:/trunk:10",
+    'Committed revision 13.',
+]);
 
 chdir($co_trunk_path);
 $svk->update();
-{ local $TODO = 'should merge things back too';
-is_file_content('module/test.txt', '4');
+lives_and {
+is_file_content('bar/test.txt', 'b');
 }


More information about the svk-commit mailing list