You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by br...@apache.org on 2012/09/27 23:39:33 UTC
svn commit: r1391227 - in
/subversion/trunk/subversion/bindings/swig/perl/native: Makefile.PL.in
t/0use.t t/1repos.t t/2fs.t t/3client.t t/4pool.t t/5delta-compat.t
t/5delta.t t/6ra.t t/7editor.t t/8lock.t
Author: breser
Date: Thu Sep 27 21:39:33 2012
New Revision: 1391227
URL: http://svn.apache.org/viewvc?rev=1391227&view=rev
Log:
Adjust swig-pl tests to have Test::Count markers and add a make target to
update the counts.
* subversion/bindings/swig/perl/native/t/0use.t
subversion/bindings/swig/perl/native/t/1repos.t
subversion/bindings/swig/perl/native/t/2fs.t
subversion/bindings/swig/perl/native/t/3client.t
subversion/bindings/swig/perl/native/t/4pool.t
subversion/bindings/swig/perl/native/t/5delta.t
subversion/bindings/swig/perl/native/t/5delta-compat.t
subversion/bindings/swig/perl/native/t/6ra.t
subversion/bindings/swig/perl/native/t/7editor.t
subversion/bindings/swig/perl/native/t/8lock.t
Add '# TEST' markers.
* subversion/bindings/swig/perl/native/Makefile.PL.in
(update_test_counts): Add target.
Modified:
subversion/trunk/subversion/bindings/swig/perl/native/Makefile.PL.in
subversion/trunk/subversion/bindings/swig/perl/native/t/0use.t
subversion/trunk/subversion/bindings/swig/perl/native/t/1repos.t
subversion/trunk/subversion/bindings/swig/perl/native/t/2fs.t
subversion/trunk/subversion/bindings/swig/perl/native/t/3client.t
subversion/trunk/subversion/bindings/swig/perl/native/t/4pool.t
subversion/trunk/subversion/bindings/swig/perl/native/t/5delta-compat.t
subversion/trunk/subversion/bindings/swig/perl/native/t/5delta.t
subversion/trunk/subversion/bindings/swig/perl/native/t/6ra.t
subversion/trunk/subversion/bindings/swig/perl/native/t/7editor.t
subversion/trunk/subversion/bindings/swig/perl/native/t/8lock.t
Modified: subversion/trunk/subversion/bindings/swig/perl/native/Makefile.PL.in
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/swig/perl/native/Makefile.PL.in?rev=1391227&r1=1391226&r2=1391227&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/swig/perl/native/Makefile.PL.in (original)
+++ subversion/trunk/subversion/bindings/swig/perl/native/Makefile.PL.in Thu Sep 27 21:39:33 2012
@@ -127,6 +127,9 @@ $module_make_commands\t\$(NOECHO) \$(TOU
FULLPERLRUN=$fullperlrun \$(FULLPERL)
+update_test_counts ::
+\tfor test_file in \$(TEST_FILES); do \$(PERL) -MTest::Count::FileMutator::ByFileType::App -e 'run()' \$\$test_file; done
+
EOPOST
}
Modified: subversion/trunk/subversion/bindings/swig/perl/native/t/0use.t
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/swig/perl/native/t/0use.t?rev=1391227&r1=1391226&r2=1391227&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/swig/perl/native/t/0use.t (original)
+++ subversion/trunk/subversion/bindings/swig/perl/native/t/0use.t Thu Sep 27 21:39:33 2012
@@ -22,10 +22,17 @@
use Test::More tests => 7;
use strict;
+# TEST
use_ok 'SVN::Core';
+# TEST
use_ok 'SVN::Repos';
+# TEST
use_ok 'SVN::Fs';
+# TEST
use_ok 'SVN::Delta';
+# TEST
use_ok 'SVN::Ra';
+# TEST
use_ok 'SVN::Wc';
+# TEST
use_ok 'SVN::Client';
Modified: subversion/trunk/subversion/bindings/swig/perl/native/t/1repos.t
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/swig/perl/native/t/1repos.t?rev=1391227&r1=1391226&r2=1391227&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/swig/perl/native/t/1repos.t (original)
+++ subversion/trunk/subversion/bindings/swig/perl/native/t/1repos.t Thu Sep 27 21:39:33 2012
@@ -35,6 +35,7 @@ my $repospath = tempdir('svn-perl-test-X
my $repos;
+# TEST
ok($repos = SVN::Repos::create("$repospath", undef, undef, undef, undef),
"create repository at $repospath");
@@ -60,6 +61,7 @@ SVN::TxDelta::send_string("FILEA CONTENT
$editor->close_edit();
+# TEST
cmp_ok($fs->youngest_rev, '==', 1);
{
$editor = SVN::Delta::Editor->
@@ -73,6 +75,7 @@ my $subdirbaton = $editor->add_directory
$editor->close_edit();
}
+# TEST
cmp_ok($fs->youngest_rev, '==', 2);
my @history;
@@ -80,6 +83,7 @@ my @history;
SVN::Repos::history($fs, 'tags/foo/filea',
sub {push @history, [@_[0,1]]}, 0, 2, 1);
+# TEST
is_deeply(\@history, [['/tags/foo/filea',2],['/trunk/filea',1]],
'repos_history');
@@ -97,8 +101,10 @@ $editor->delete_entry('tags', 2, $rootba
$editor->close_edit();
}
+# TEST
ok($main::something_destroyed, 'callback properly destroyed');
+# TEST
cmp_ok($fs->youngest_rev, '==', 3);
END {
Modified: subversion/trunk/subversion/bindings/swig/perl/native/t/2fs.t
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/swig/perl/native/t/2fs.t?rev=1391227&r1=1391226&r2=1391227&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/swig/perl/native/t/2fs.t (original)
+++ subversion/trunk/subversion/bindings/swig/perl/native/t/2fs.t Thu Sep 27 21:39:33 2012
@@ -36,24 +36,32 @@ my $repospath = tempdir('svn-perl-test-X
my $repos;
+# TEST
ok($repos = SVN::Repos::create("$repospath", undef, undef, undef, undef),
"create repository at $repospath");
my $fs = $repos->fs;
+# TEST
cmp_ok($fs->youngest_rev, '==', 0,
"new repository start with rev 0");
+# TEST
is($fs->path, "$repospath/db", '$fs->path()');
+# TEST
is(SVN::Fs::type($fs->path), 'fsfs', 'SVN::Fs::type()');
my $txn = $fs->begin_txn($fs->youngest_rev);
my $txns = $fs->list_transactions;
+# TEST
ok(eq_array($fs->list_transactions, [$txn->name]), 'list transaction');
+# TEST
isa_ok($txn->root, '_p_svn_fs_root_t', '$txn->root()');
+# TEST
is($txn->root->txn_name, $txn->name, '$txn->root->txn_name()');
+# TEST
is($fs->revision_root($fs->youngest_rev)->txn_name, undef);
$txn->root->make_dir('trunk');
@@ -63,32 +71,43 @@ my $text = "this is just a test\n";
$txn->root->make_file($path);
{
my $stream = $txn->root->apply_text($path, undef);
+ # TEST
isa_ok($stream, 'SVN::Stream', '$txn->root->apply_text');
print $stream $text;
close $stream;
}
$txn->commit;
+# TEST
cmp_ok($fs->youngest_rev, '==', 1, 'revision increased');
my $root = $fs->revision_root($fs->youngest_rev);
+# TEST
cmp_ok($root->check_path($path), '==', $SVN::Node::file, 'check_path');
+# TEST
ok(!$root->is_dir($path), 'is_dir');
+# TEST
ok($root->is_file($path), 'is_file');
{
my $stream = $root->file_contents($path);
local $/;
+ # TEST
is(<$stream>, $text, 'content verified');
+ # TEST
is($root->file_md5_checksum($path), 'dd2314129f81675e95b940ff94ddc935',
'md5 verified');
}
+# TEST
cmp_ok($root->file_length($path), '==', length($text), 'file_length');
# Revision properties
+# TEST
isa_ok($fs->revision_proplist(1), 'HASH', 'revision_proplist: object');
+# TEST
is($fs->revision_prop(1, 'not:exists'), undef, 'revision_prop: nonexistent');
+# TEST
like($fs->revision_prop(1, 'svn:date'), qr/^\d+-\d+-\d+T\d+:\d+:\d+\.\d+Z$/,
'revision_prop: svn:date');
@@ -108,12 +127,15 @@ SKIP: {
or die "error making hook script '$script_filename' executable: $!";
$fs->change_rev_prop(1, 'test-prop', 'foo');
+ # TEST
is($fs->revision_prop(1, 'test-prop'), 'foo', 'change_rev_prop');
$fs->change_rev_prop(1, 'test-prop', undef);
+ # TEST
is($fs->revision_prop(1, 'test-prop'), undef, 'change_rev_prop: deleted');
$fs->change_rev_prop(1, 'binary-prop', $BINARY_DATA);
+ # TEST
is($fs->revision_prop(1, 'binary-prop'), $BINARY_DATA,
'change_rev_prop with binary data');
}
Modified: subversion/trunk/subversion/bindings/swig/perl/native/t/3client.t
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/swig/perl/native/t/3client.t?rev=1391227&r1=1391226&r2=1391227&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/swig/perl/native/t/3client.t (original)
+++ subversion/trunk/subversion/bindings/swig/perl/native/t/3client.t Thu Sep 27 21:39:33 2012
@@ -28,9 +28,13 @@ use strict;
# by the bindings but not elsewhere in perl space.
no warnings 'once';
+# TEST
use_ok('SVN::Core');
+# TEST
use_ok('SVN::Repos');
+# TEST
use_ok('SVN::Client');
+# TEST
use_ok('SVN::Wc'); # needed for status
use File::Spec::Functions;
use File::Temp qw(tempdir);
@@ -67,74 +71,101 @@ if ($^O eq 'MSWin32') {
# This is ugly to create the test repo with SVN::Repos, but
# it seems to be the most reliable way.
+# TEST
ok(SVN::Repos::create("$repospath", undef, undef, undef, undef),
"create repository at $repospath");
my ($ctx) = SVN::Client->new;
+# TEST
isa_ok($ctx,'SVN::Client','Client Object');
my $uuid_from_url = $ctx->uuid_from_url($reposurl);
+# TEST
ok($uuid_from_url,'Valid return from uuid_from_url method form');
# test non method invocation passing a SVN::Client
+# TEST
ok(SVN::Client::uuid_from_url($reposurl,$ctx),
'Valid return from uuid_from_url function form with SVN::Client object');
# test non method invocation passing a _p_svn_client_ctx_t
+# TEST
ok(SVN::Client::uuid_from_url($reposurl,$ctx->{'ctx'}),
'Valid return from uuid_from_url function form with _p_svn_client_ctx object');
my ($ci_dir1) = $ctx->mkdir(["$reposurl/dir1"]);
+# TEST
isa_ok($ci_dir1,'_p_svn_client_commit_info_t');
$current_rev++;
+# TEST
is($ci_dir1->revision,$current_rev,"commit info revision equals $current_rev");
my ($rpgval,$rpgrev) = $ctx->revprop_get('svn:author',$reposurl,$current_rev);
+# TEST
is($rpgval,$username,'svn:author set to expected username from revprop_get');
+# TEST
is($rpgrev,$current_rev,'Returned revnum of current rev from revprop_get');
if ($^O eq 'MSWin32') {
+ # TEST
ok(open(NEW, ">$repospath/hooks/pre-revprop-change.bat"),
'Open pre-revprop-change hook for writing');
+ # TEST
ok(print(NEW 'exit 0'), 'Print to hook');
+ # TEST
ok(close(NEW), 'Close hook');
} else {
+ # TEST
ok(rename("$repospath/hooks/pre-revprop-change.tmpl",
"$repospath/hooks/pre-revprop-change"),
'Rename pre-revprop-change hook');
+ # TEST
ok(chmod(0700,"$repospath/hooks/pre-revprop-change"),
'Change permissions on pre-revprop-change hook');
+ # TEST
is(1, 1, '-')
}
my ($rps_rev) = $ctx->revprop_set('svn:log','mkdir dir1',
$reposurl, $current_rev, 0);
+# TEST
is($rps_rev,$current_rev,
'Returned revnum of current rev from revprop_set');
my ($rph, $rplrev) = $ctx->revprop_list($reposurl,$current_rev);
+# TEST
isa_ok($rph,'HASH','Returned hash reference form revprop_list');
+# TEST
is($rplrev,$current_rev,'Returned current rev from revprop_list');
+# TEST
is($rph->{'svn:author'},$username,
'svn:author is expected user from revprop_list');
+# TEST
is($rph->{'svn:log'},'mkdir dir1',
'svn:log is expected value from revprop_list');
+# TEST
ok($rph->{'svn:date'},'svn:date is set from revprop_list');
+# TEST
is($ctx->checkout($reposurl,$wcpath,'HEAD',1),$current_rev,
'Returned current rev from checkout');
+# TEST
is(SVN::Client::url_from_path($wcpath),$reposurl,
"Returned $reposurl from url_from_path");
+# TEST
ok(open(NEW, ">$wcpath/dir1/new"),'Open new file for writing');
+# TEST
ok(print(NEW 'addtest'), 'Print to new file');
+# TEST
ok(close(NEW),'Close new file');
# no return means success
+# TEST
is($ctx->add("$wcpath/dir1/new",0),undef,
'Returned undef from add schedule operation');
@@ -143,37 +174,51 @@ $ctx->log_msg(
sub
{
my ($log_msg,$tmp_file,$commit_items,$pool) = @_;
+ # TEST
isa_ok($log_msg,'SCALAR','log_msg param to callback is a SCALAR');
+ # TEST
isa_ok($tmp_file,'SCALAR','tmp_file param to callback is a SCALAR');
+ # TEST
isa_ok($commit_items,'ARRAY',
'commit_items param to callback is a SCALAR');
+ # TEST
isa_ok($pool,'_p_apr_pool_t',
'pool param to callback is a _p_apr_pool_t');
my $commit_item = shift @$commit_items;
+ # TEST
isa_ok($commit_item,'_p_svn_client_commit_item3_t',
'commit_item element is a _p_svn_client_commit_item3_t');
+ # TEST
is($commit_item->path(),"$wcpath/dir1/new",
"commit_item has proper path for committed file");
+ # TEST
is($commit_item->kind(),$SVN::Node::file,
"kind() shows the node as a file");
+ # TEST
is($commit_item->url(),"$reposurl/dir1/new",
'URL matches our repos url');
# revision is INVALID because the commit has not happened yet
# and this is not a copy
+ # TEST
is($commit_item->revision(),$SVN::Core::INVALID_REVNUM,
'Revision is INVALID since commit has not happened yet');
+ # TEST
is($commit_item->copyfrom_url(),undef,
'copyfrom_url is undef since file is not a copy');
+ # TEST
is($commit_item->state_flags(),$SVN::Client::COMMIT_ITEM_ADD |
$SVN::Client::COMMIT_ITEM_TEXT_MODS,
'state_flags are ADD and TEXT_MODS');
my $prop_changes = $commit_item->incoming_prop_changes();
+ # TEST
isa_ok($prop_changes, 'ARRAY',
'incoming_prop_changes returns an ARRAY');
+ # TEST
is(scalar(@$prop_changes), 0,
'No elements in the incoming_prop_changes array because ' .
' we did not make any');
$prop_changes = $commit_item->outgoing_prop_changes();
+ # TEST
is($prop_changes, undef,
'No outgoing_prop_changes array because we did not create one');
$$log_msg = 'Add new';
@@ -182,23 +227,30 @@ $ctx->log_msg(
my ($ci_commit1) = $ctx->commit($wcpath,0);
+# TEST
isa_ok($ci_commit1,'_p_svn_client_commit_info_t',
'Commit returns a _p_svn_client_commit_info');
$current_rev++;
+# TEST
is($ci_commit1->revision,$current_rev,
"commit info revision equals $current_rev");
# get rid of log_msg callback
+# TEST
is($ctx->log_msg(undef),undef,
'Clearing the log_msg callback works');
# test info() on WC
+# TEST
is($ctx->info("$wcpath/dir1/new", undef, 'WORKING',
sub
{
my($infopath,$svn_info_t,$pool) = @_;
+ # TEST
is($infopath,"new",'path passed to receiver is same as WC');
+ # TEST
isa_ok($svn_info_t,'_p_svn_info_t');
+ # TEST
isa_ok($pool,'_p_apr_pool_t',
'pool param is _p_apr_pool_t');
}, 0),
@@ -206,80 +258,106 @@ is($ctx->info("$wcpath/dir1/new", undef,
'info should return undef');
my $svn_error = $ctx->info("$wcpath/dir1/newxyz", undef, 'WORKING', sub {}, 0);
+# TEST
isa_ok($svn_error, '_p_svn_error_t',
'info should return _p_svn_error_t for a nonexistent file');
$svn_error->clear(); #don't leak this
# test getting the log
+# TEST
is($ctx->log("$reposurl/dir1/new",$current_rev,$current_rev,1,0,
sub
{
my ($changed_paths,$revision,
$author,$date,$message,$pool) = @_;
+ # TEST
isa_ok($changed_paths,'HASH',
'changed_paths param is a HASH');
+ # TEST
isa_ok($changed_paths->{'/dir1/new'},
'_p_svn_log_changed_path_t',
'Hash value is a _p_svn_log_changed_path_t');
+ # TEST
is($changed_paths->{'/dir1/new'}->action(),'A',
'action returns A for add');
+ # TEST
is($changed_paths->{'/dir1/new'}->copyfrom_path(),undef,
'copyfrom_path returns undef as it is not a copy');
+ # TEST
is($changed_paths->{'/dir1/new'}->copyfrom_rev(),
$SVN::Core::INVALID_REVNUM,
'copyfrom_rev is set to INVALID as it is not a copy');
+ # TEST
is($revision,$current_rev,
'revision param matches current rev');
+ # TEST
is($author,$username,
'author param matches expected username');
+ # TEST
ok($date,'date param is defined');
+ # TEST
is($message,'Add new',
'message param is the expected value');
+ # TEST
isa_ok($pool,'_p_apr_pool_t',
'pool param is _p_apr_pool_t');
}),
undef,
'log returns undef');
+# TEST
is($ctx->update($wcpath,'HEAD',1),$current_rev,
'Return from update is the current rev');
# no return so we should get undef as the result
# we will get a _p_svn_error_t if there is an error.
+# TEST
is($ctx->propset('perl-test','test-val',"$wcpath/dir1",0),undef,
'propset on a working copy path returns undef');
my ($ph) = $ctx->propget('perl-test',"$wcpath/dir1",undef,0);
+# TEST
isa_ok($ph,'HASH','propget returns a hash');
+# TEST
is($ph->{"$wcpath/dir1"},'test-val','perl-test property has the correct value');
# No revnum for the working copy so we should get INVALID_REVNUM
+# TEST
is($ctx->status($wcpath, undef, sub {
my ($path,$wc_status) = @_;
+ # TEST
is($path,"$wcpath/dir1",
'path param to status callback is' .
' the correct path.');
+ # TEST
isa_ok($wc_status,'_p_svn_wc_status_t',
'wc_stats param is a' .
' _p_svn_wc_status_t');
+ # TEST
is($wc_status->text_status(),
$SVN::Wc::Status::normal,
'text_status param to status' .
' callback');
+ # TEST
is($wc_status->prop_status(),
$SVN::Wc::Status::modified,
'prop_status param to status' .
' callback');
+ # TEST
is($wc_status->locked(), 0,
'locked param to status callback');
+ # TEST
is($wc_status->copied(), 0,
'copied param to status callback');
+ # TEST
is($wc_status->switched(), 0,
'switched param to status callback');
+ # TEST
is($wc_status->repos_text_status(),
$SVN::Wc::Status::none,
'repos_text_status param to status' .
' callback');
+ # TEST
is($wc_status->repos_prop_status(),
$SVN::Wc::Status::none,
'repos_prop_status param to status' .
@@ -290,60 +368,79 @@ is($ctx->status($wcpath, undef, sub {
'status returns INVALID_REVNUM when run against a working copy');
# No revnum for the working copy so we should get INVALID_REVNUM
+# TEST
is($ctx->status2($wcpath, undef, sub {
my ($path,$wc_status) = @_;
+ # TEST
is($path,"$wcpath/dir1",
'path param to status2 callback');
+ # TEST
isa_ok($wc_status,'_p_svn_wc_status2_t',
'wc_stats param to the status2' .
' callback');
+ # TEST
is($wc_status->text_status(),
$SVN::Wc::Status::normal,
'text_status param to status2' .
' callback');
+ # TEST
is($wc_status->prop_status(),
$SVN::Wc::Status::modified,
'prop_status param to status2' .
' callback');
+ # TEST
is($wc_status->locked(), 0,
'locked param to status2' .
' callback');
+ # TEST
is($wc_status->copied(), 0,
'copied param to status2' .
' callback');
+ # TEST
is($wc_status->switched(), 0,
'switched param to status2' .
' callback');
+ # TEST
is($wc_status->repos_text_status(),
$SVN::Wc::Status::none,
'repos_text_status param to status2' .
' callback');
+ # TEST
is($wc_status->repos_prop_status(),
$SVN::Wc::Status::none,
'repos_prop_status param to status2' .
' callback');
+ # TEST
is($wc_status->repos_lock(), undef,
'repos_lock param to status2 callback');
+ # TEST
is($wc_status->url(),"$reposurl/dir1",
'url param to status2 callback');
+ # TEST
is($wc_status->ood_last_cmt_rev(),
$SVN::Core::INVALID_REVNUM,
'ood_last_cmt_rev to status2' .
' callback');
+ # TEST
is($wc_status->ood_last_cmt_date(), 0,
'ood_last_cmt_date to status2' .
' callback');
+ # TEST
is($wc_status->ood_kind(),
$SVN::Node::none,
'ood_kind param to status2 callback');
+ # TEST
is($wc_status->tree_conflict(), undef,
'tree_conflict to status2 callback');
+ # TEST
is($wc_status->file_external(), 0,
'file_external to status2 callback');
+ # TEST
is($wc_status->pristine_text_status(),
$SVN::Wc::Status::normal,
'pristine_text_status param to' .
' status2 callback');
+ # TEST
is($wc_status->pristine_prop_status(),
$SVN::Wc::Status::modified,
'pristine_prop_status param to' .
@@ -354,9 +451,11 @@ is($ctx->status2($wcpath, undef, sub {
'status2 returns INVALID_REVNUM when run against a working copy');
my ($ci_commit2) = $ctx->commit($wcpath,0);
+# TEST
isa_ok($ci_commit2,'_p_svn_client_commit_info_t',
'commit returns a _p_svn_client_commit_info_t');
$current_rev++;
+# TEST
is($ci_commit2->revision(),$current_rev,
"commit info revision equals $current_rev");
@@ -364,74 +463,100 @@ my $dir1_rev = $current_rev;
my($pl) = $ctx->proplist($reposurl,$current_rev,1);
+# TEST
isa_ok($pl,'ARRAY','proplist returns an ARRAY');
+# TEST
isa_ok($pl->[0], '_p_svn_client_proplist_item_t',
'array element is a _p_svn_client_proplist_item_t');
+# TEST
is($pl->[0]->node_name(),"$reposurl/dir1",
'node_name is the expected value');
my $plh = $pl->[0]->prop_hash();
+# TEST
isa_ok($plh,'HASH',
'prop_hash returns a HASH');
+# TEST
is_deeply($plh, {'perl-test' => 'test-val'}, 'test prop list prop_hash values');
# add a dir to test update
my ($ci_dir2) = $ctx->mkdir(["$reposurl/dir2"]);
+# TEST
isa_ok($ci_dir2,'_p_svn_client_commit_info_t',
'mkdir returns a _p_svn_client_commit_info_t');
$current_rev++;
+# TEST
is($ci_dir2->revision(),$current_rev,
"commit info revision equals $current_rev");
# Use explicit revnum to test that instead of just HEAD.
+# TEST
is($ctx->update($wcpath,$current_rev,$current_rev),$current_rev,
'update returns current rev');
# commit action against a repo returns undef
+# TEST
is($ctx->delete(["$wcpath/dir2"],0),undef,
'delete returns undef');
# no return means success
+# TEST
is($ctx->revert($wcpath,1),undef,
'revert returns undef');
my ($ci_copy) = $ctx->copy("$reposurl/dir1",2,"$reposurl/dir3");
+# TEST
isa_ok($ci_copy,'_p_svn_client_commit_info_t',
'copy returns a _p_svn_client_commitn_info_t when run against repo');
$current_rev++;
+# TEST
is($ci_copy->revision,$current_rev,
"commit info revision equals $current_rev");
+# TEST
ok(mkdir($importpath),'Make import path dir');
+# TEST
ok(open(FOO, ">$importpath/foo"),'Open file for writing in import path dir');
+# TEST
ok(print(FOO 'foobar'),'Print to the file in import path dir');
+# TEST
ok(close(FOO),'Close file in import path dir');
my ($ci_import) = $ctx->import($importpath,$reposurl,0);
+# TEST
isa_ok($ci_import,'_p_svn_client_commit_info_t',
'Import returns _p_svn_client_commint_info_t');
$current_rev++;
+# TEST
is($ci_import->revision,$current_rev,
"commit info revision equals $current_rev");
+# TEST
is($ctx->blame("$reposurl/foo",'HEAD','HEAD', sub {
my ($line_no,$rev,$author,
$date, $line,$pool) = @_;
+ # TEST
is($line_no,0,
'line_no param is zero');
+ # TEST
is($rev,$current_rev,
'rev param is current rev');
+ # TEST
is($author,$username,
'author param is expected' .
'value');
+ # TEST
ok($date,'date is defined');
if ($^O eq 'MSWin32') {
#### Why two \r-s?
+ # TEST
is($line,"foobar\r\r",
'line is expected value');
} else {
+ # TEST
is($line,'foobar',
'line is expected value');
}
+ # TEST
isa_ok($pool,'_p_apr_pool_t',
'pool param is ' .
'_p_apr_pool_t');
@@ -439,42 +564,58 @@ is($ctx->blame("$reposurl/foo",'HEAD','H
undef,
'blame returns undef');
+# TEST
ok(open(CAT, "+>$testpath/cattest"),'open file for cat output');
+# TEST
is($ctx->cat(\*CAT, "$reposurl/foo", 'HEAD'),undef,
'cat returns undef');
+# TEST
ok(seek(CAT,0,0),
'seek the beginning of the cat file');
+# TEST
is(readline(*CAT),'foobar',
'read the first line of the cat file');
+# TEST
ok(close(CAT),'close cat file');
# the string around the $current_rev exists to expose a past
# bug. In the past we did not accept values that simply
# had not been converted to a number yet.
my ($dirents) = $ctx->ls($reposurl,"$current_rev", 1);
+# TEST
isa_ok($dirents, 'HASH','ls returns a HASH');
+# TEST
isa_ok($dirents->{'dir1'},'_p_svn_dirent_t',
'hash value is a _p_svn_dirent_t');
+# TEST
is($dirents->{'dir1'}->kind(),$SVN::Core::node_dir,
'kind() returns a dir node');
+# TEST
is($dirents->{'dir1'}->size(),0,
'size() returns 0 for a directory');
+# TEST
is($dirents->{'dir1'}->has_props(),1,
'has_props() returns true');
+# TEST
is($dirents->{'dir1'}->created_rev(),$dir1_rev,
'created_rev() returns expected rev');
+# TEST
ok($dirents->{'dir1'}->time(),
'time is defined');
#diag(scalar(localtime($dirents->{'dir1'}->time() / 1000000)));
+# TEST
is($dirents->{'dir1'}->last_author(),$username,
'last_auth() returns expected username');
# test removing a property
+# TEST
is($ctx->propset('perl-test', undef, "$wcpath/dir1", 0),undef,
'propset returns undef');
my ($ph2) = $ctx->propget('perl-test', "$wcpath/dir1", 'WORKING', 0);
+# TEST
isa_ok($ph2,'HASH','propget returns HASH');
+# TEST
is(scalar(keys %$ph2),0,
'No properties after deleting a property');
@@ -537,6 +678,7 @@ SKIP: {
my $oldauthbaton = $ctx->auth();
+ # TEST
isa_ok($ctx->auth(SVN::Client::get_simple_prompt_provider(
sub { simple_prompt(@_,'x') },2),
SVN::Client::get_ssl_server_trust_prompt_provider(
@@ -551,9 +693,11 @@ SKIP: {
# if this doesn't work we will get an svn_error_t so by
# getting a hash we know it worked.
my ($dirents) = $ctx->ls('https://localhost/svn/test','HEAD',1);
+ # TEST
isa_ok($dirents,'HASH','ls returns a HASH');
# return the auth baton to its original setting
+ # TEST
isa_ok($ctx->auth($oldauthbaton),'_p_svn_auth_baton_t',
'Successfully set auth_baton back to old value');
}
@@ -569,6 +713,7 @@ my @providers = @{SVN::Core::auth_get_pl
foreach my $p (@providers) {
$ok &= defined($p) && $p->isa('_p_svn_auth_provider_object_t');
}
+# TEST
ok($ok, 'svn_auth_get_platform_specific_client_providers returns _p_svn_auth_provider_object_t\'s');
SKIP: {
@@ -590,6 +735,7 @@ SKIP: {
my $callback = \&gnome_keyring_unlock_prompt;
my $result = SVN::Core::auth_set_gnome_keyring_unlock_prompt_func(
$ctx->auth(), $callback);
+ # TEST
is(${$result}, $callback, 'auth_set_gnome_keyring_unlock_prompt_func result equals paramter');
}
Modified: subversion/trunk/subversion/bindings/swig/perl/native/t/4pool.t
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/swig/perl/native/t/4pool.t?rev=1391227&r1=1391226&r2=1391227&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/swig/perl/native/t/4pool.t (original)
+++ subversion/trunk/subversion/bindings/swig/perl/native/t/4pool.t Thu Sep 27 21:39:33 2012
@@ -55,6 +55,7 @@ my $repospath = tempdir('svn-perl-test-X
my $repos;
+# TEST
ok($repos = SVN::Repos::create("$repospath", undef, undef, undef, undef),
"create repository at $repospath");
@@ -62,19 +63,23 @@ my $fs = $repos->fs;
my $pool = SVN::Pool->new_default;
+# TEST
is_pool_default($pool, 'default pool');
{
my $spool = SVN::Pool->new_default_sub;
+ # TEST
is_pool_default($spool, 'lexical default pool default');
}
+# TEST
is_pool_default($pool, 'lexical default pool destroyed');
my $root = $fs->revision_root(0);
my $txn = $fs->begin_txn(0);
+# TEST
$txn->root->make_dir('trunk');
$txn->commit;
@@ -86,6 +91,7 @@ SVN::Repos::dir_delta($root, '', '',
undef, 1, 1, 0, 1);
+# TEST
is_pool_default($pool, 'default pool from c calls destroyed');
END {
Modified: subversion/trunk/subversion/bindings/swig/perl/native/t/5delta-compat.t
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/swig/perl/native/t/5delta-compat.t?rev=1391227&r1=1391226&r2=1391227&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/swig/perl/native/t/5delta-compat.t (original)
+++ subversion/trunk/subversion/bindings/swig/perl/native/t/5delta-compat.t Thu Sep 27 21:39:33 2012
@@ -33,11 +33,13 @@ open my $aresult, '>', \$result;
my $txstream = SVN::TxDelta::new($source, $target);
+# TEST
isa_ok($txstream, '_p_svn_txdelta_stream_t');
open my $asource, '<', \$srctext;
my $handle = [SVN::TxDelta::apply($asource, $aresult, undef, undef)];
SVN::TxDelta::send_txstream($txstream, @$handle);
+# TEST
is($result, $tgttext, 'delta self test');
Modified: subversion/trunk/subversion/bindings/swig/perl/native/t/5delta.t
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/swig/perl/native/t/5delta.t?rev=1391227&r1=1391226&r2=1391227&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/swig/perl/native/t/5delta.t (original)
+++ subversion/trunk/subversion/bindings/swig/perl/native/t/5delta.t Thu Sep 27 21:39:33 2012
@@ -33,12 +33,15 @@ open my $aresult, '>', \$result;
my $txstream = SVN::TxDelta::new($source, $target);
+# TEST
isa_ok($txstream, '_p_svn_txdelta_stream_t');
open my $asource, '<', \$srctext;
my ($md5, @handle) = SVN::TxDelta::apply($asource, $aresult, undef);
SVN::TxDelta::send_txstream($txstream, @handle);
+# TEST
is($result, $tgttext, 'delta self test');
+# TEST
is("$md5", 'a22b3dadcbddac48d2f1eae3ec5fb86a', 'md5 matched');
Modified: subversion/trunk/subversion/bindings/swig/perl/native/t/6ra.t
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/swig/perl/native/t/6ra.t?rev=1391227&r1=1391226&r2=1391227&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/swig/perl/native/t/6ra.t (original)
+++ subversion/trunk/subversion/bindings/swig/perl/native/t/6ra.t Thu Sep 27 21:39:33 2012
@@ -36,6 +36,7 @@ my $BINARY_DATA = "foo\0\n\t\x1F\x7F\x80
my $repospath = tempdir('svn-perl-test-XXXXXX', TMPDIR => 1, CLEANUP => 1);
my $repos;
+# TEST
ok($repos = SVN::Repos::create("$repospath", undef, undef, undef, undef),
"create repository at $repospath");
@@ -61,25 +62,36 @@ $uri = "file://$uri";
{
my $ra = SVN::Ra->new($uri);
+ # TEST
isa_ok($ra, 'SVN::Ra', 'create with only one argument');
}
my $ra = SVN::Ra->new(url => $uri);
+# TEST
isa_ok($ra, 'SVN::Ra', 'create with hash param');
+# TEST
is($ra->get_uuid, $fs->get_uuid, 'get_uuid');
+# TEST
is($ra->get_latest_revnum, 2, 'get_latest_revnum');
+# TEST
is($ra->get_repos_root, $uri, 'get_repos_root');
# get_dir
{
my ($dirents, $revnum, $props) = $ra->get_dir('trunk',
$SVN::Core::INVALID_REVNUM);
+ # TEST
isa_ok($dirents, 'HASH', 'get_dir: dirents');
+ # TEST
is(scalar(keys %$dirents), 2, 'get_dir: num dirents');
+ # TEST+2
isa_ok($dirents->{$_}, '_p_svn_dirent_t', "get_dir: dirent $_")
for qw( filea fileb );
+ # TEST
is($revnum, $ra->get_latest_revnum, 'get_dir: revnum');
+ # TEST
isa_ok($props, 'HASH', 'get_dir: props');
+ # TEST
is($props->{'dir-prop'}, 'frob', 'get_dir: property dir-prop');
}
@@ -87,15 +99,22 @@ is($ra->get_repos_root, $uri, 'get_repos
{
my ($revnum, $props) = $ra->get_file('trunk/filea',
$SVN::Core::INVALID_REVNUM, undef);
+ # TEST
is($revnum, $ra->get_latest_revnum, 'get_file: revnum');
+ # TEST
isa_ok($props, 'HASH', 'get_file: props');
+ # TEST
ok(!exists $props->{'test-prop'}, 'get_file: property test-prop deleted');
+ # TEST
is($props->{'binary-prop'}, $BINARY_DATA, 'get_file: property binary-prop');
}
# Revision properties
+# TEST
isa_ok($ra->rev_proplist(1), 'HASH', 'rev_proplist: object');
+# TEST
is($ra->rev_prop(1, 'nonexistent'), undef, 'rev_prop: nonexistent');
+# TEST
like($ra->rev_prop(1, 'svn:date'), qr/^\d+-\d+-\d+T\d+:\d+:\d+\.\d+Z$/,
'rev_prop: svn:date');
@@ -115,51 +134,71 @@ SKIP: {
or die "error making hook script '$script_filename' executable: $!";
$ra->change_rev_prop(1, 'test-prop', 'foo');
+ # TEST
is($ra->rev_prop(1, 'test-prop'), 'foo', 'change_rev_prop');
$ra->change_rev_prop(1, 'test-prop', undef);
+ # TEST
is($ra->rev_prop(1, 'test-prop'), undef, 'change_rev_prop: deleted');
$ra->change_rev_prop(1, 'binary-prop', $BINARY_DATA);
+ # TEST
is($ra->rev_prop(1, 'binary-prop'), $BINARY_DATA,
'change_rev_prop with binary data');
}
# Information about nodes in the filesystem.
+# TEST
is($ra->check_path('trunk', 1), $SVN::Node::dir, 'check_path');
{
my $dirent = $ra->stat('trunk', 1);
+ # TEST
isa_ok($dirent, '_p_svn_dirent_t', 'stat dir: dirent object');
+ # TEST
is($dirent->kind, $SVN::Node::dir, 'stat dir: kind');
+ # TEST
is($dirent->size, 0, 'stat dir: size');
+ # TEST
is($dirent->created_rev, 1, 'stat dir: created_rev');
+ # TEST
ok($dirent->has_props, 'stat dir: has_props');
$dirent = $ra->stat('trunk/fileb', 1);
+ # TEST
is($dirent->kind, $SVN::Node::file, 'stat file: kind');
+ # TEST
ok(!$dirent->has_props, 'stat file: has_props');
}
# do_update
my $ed = MockEditor->new;
my $reporter = $ra->do_update(2, '', 1, $ed);
+# TEST
isa_ok($reporter, 'SVN::Ra::Reporter');
$reporter->set_path('', 0, 1, undef);
$reporter->finish_report;
+# TEST
is($ed->{_base_revnum}, 0, 'do_update: base_revision');
+# TEST
is($ed->{_target_revnum}, 2, 'do_update: target_revnum');
+# TEST
is($ed->{trunk}{props}{'dir-prop'}, 'frob', 'do_update: dir-prop');
+# TEST
ok(!exists $ed->{'trunk/filea'}{props}{'test-prop'},
'do_update: deleted property');
+# TEST
is($ed->{'trunk/filea'}{props}{'binary-prop'}, $BINARY_DATA,
'do_update: binary-prop');
# replay
$ed = MockEditor->new;
$ra->replay(1, 0, 1, $ed);
+# TEST
is($ed->{trunk}{type}, 'dir', "replay: got trunk");
+# TEST
is($ed->{trunk}{props}{'dir-prop'}, 'frob', 'replay: dir-prop');
+# TEST
is($ed->{'trunk/filea'}{props}{'binary-prop'}, $BINARY_DATA,
'replay: binary-prop');
Modified: subversion/trunk/subversion/bindings/swig/perl/native/t/7editor.t
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/swig/perl/native/t/7editor.t?rev=1391227&r1=1391226&r2=1391227&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/swig/perl/native/t/7editor.t (original)
+++ subversion/trunk/subversion/bindings/swig/perl/native/t/7editor.t Thu Sep 27 21:39:33 2012
@@ -62,6 +62,7 @@ SVN::Repos::dir_delta($fs->revision_root
MyEditor->new(crap => bless {}, 'something'),
undef, 1, 1, 0, 0);
};
+# TEST
ok($main::something_destroyed, 'editor');
package something;
Modified: subversion/trunk/subversion/bindings/swig/perl/native/t/8lock.t
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/swig/perl/native/t/8lock.t?rev=1391227&r1=1391226&r2=1391227&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/swig/perl/native/t/8lock.t (original)
+++ subversion/trunk/subversion/bindings/swig/perl/native/t/8lock.t Thu Sep 27 21:39:33 2012
@@ -37,12 +37,14 @@ my $repospath = tempdir('svn-perl-test-X
my $repos;
+# TEST
ok($repos = SVN::Repos::create("$repospath", undef, undef, undef, undef),
"create repository at $repospath");
my $fs = $repos->fs;
my $acc = SVN::Fs::create_access('foo');
+# TEST
is($acc->get_username, 'foo');
$fs->set_access($acc);
@@ -58,11 +60,15 @@ my $token = "opaquelocktoken:notauuid-$$
$fs->lock('/testfile', $token, 'we hate software', 0, 0, $fs->youngest_rev, 0);
+# TEST
ok(my $lock = $fs->get_lock('/testfile'));
+# TEST
is($lock->token, $token);
+# TEST
is($lock->owner, 'foo');
$acc = SVN::Fs::create_access('fnord');
+# TEST
is($acc->get_username, 'fnord');
$fs->set_access($acc);
@@ -70,11 +76,13 @@ eval {
$fs->lock('/testfile', $token, 'we hate software', 0, 0, $fs->youngest_rev, 0);
};
+# TEST
like($@, qr/already locked/);
eval {
$fs->unlock('/testfile', 'software', 0)
};
+# TEST
like($@, qr/no such lock/);
$fs->unlock('/testfile', 'software', 1);