[Bps-public-commit] r14310 - Pushmi/branches/lock/t

clkao at bestpractical.com clkao at bestpractical.com
Fri Jul 18 22:45:32 EDT 2008


Author: clkao
Date: Fri Jul 18 22:45:31 2008
New Revision: 14310

Modified:
   Pushmi/branches/lock/t/lock.t

Log:
more lock tests.

Modified: Pushmi/branches/lock/t/lock.t
==============================================================================
--- Pushmi/branches/lock/t/lock.t	(original)
+++ Pushmi/branches/lock/t/lock.t	Fri Jul 18 22:45:31 2008
@@ -9,7 +9,9 @@
 plan skip_all => 'requires 1.6.0 for lock'
     if $SVN::Core::VERSION lt '1.6.0';
 
-plan tests => 13;
+plan tests => 18;
+
+my $user = $ENV{USER};
 
 my ($svk,
     $uri, $srepos, undef, undef, $scorpath,
@@ -29,7 +31,7 @@
 is($srepos->fs->youngest_rev, 2, 'committed via hook');
 
 is_svn_output(['lock', -m => 'lock from slave', 'fromsvn.txt'],
-              ["'fromsvn.txt' locked by user 'clkao'."]);
+              ["'fromsvn.txt' locked by user '$user'."]);
 my $lock = $repos->fs->get_lock('/fromsvn.txt');
 $lock = $lock->token if $lock;
 ok($lock, 'has lock on slave');
@@ -44,3 +46,18 @@
 
 ok(!$repos->fs->get_lock('/fromsvn.txt'), 'unlocked for slave');
 ok(!$srepos->fs->get_lock('/fromsvn.txt'), 'unlocked for msater');
+
+# lock from url 
+is_svn_output(['lock', -m => 'lock from slave', $muri.'/fromsvn.txt'],
+              ["'fromsvn.txt' locked by user '$user'."]);
+
+is_svn_output(['lock', -m => 'lock from slave', $uri.'/fromsvn.txt'],[],
+              [qr{svn: warning: Path '/fromsvn.txt' is already locked by user '$user' in filesystem}]);
+
+is_svn_output(['lock', -m => 'lock from slave', 'fromsvn.txt'], [],
+              [qr{svn: warning: Path '/fromsvn.txt' is already locked by user '$user' in filesystem}]);
+
+is_svn_output(['lock', -m => 'lock from slave', '--force', 'fromsvn.txt'],
+              ["'fromsvn.txt' locked by user '$user'."]);
+
+is($repos->fs->get_lock('/fromsvn.txt')->token, $srepos->fs->get_lock('/fromsvn.txt')->token, 'lock identical after stealing');



More information about the Bps-public-commit mailing list