Fix compiler warning due to missing function prototype.
[svn.git] / subversion / bindings / swig / perl / native / t / 7editor.t
blob9b9beac12d6a3174af62a130bc766438726d27b0
1 #!/usr/bin/perl -w
2 package MyEditor;
3 our @ISA = ('SVN::Delta::Editor');
5 sub add_file {
6 die;
9 package main;
10 use Test::More tests => 1;
11 use File::Temp qw(tempdir);
12 use File::Path qw(rmtree);
13 use strict;
15 require SVN::Core;
16 require SVN::Repos;
17 require SVN::Fs;
18 require SVN::Delta;
20 my $repospath = tempdir('svn-perl-test-XXXXXX', TMPDIR => 1, CLEANUP => 1);
21 my $repos = SVN::Repos::create("$repospath", undef, undef, undef, undef);
22 my $fs = $repos->fs;
24 sub committed {
25 diag "committed ".join(',',@_);
28 my $editor = SVN::Delta::Editor->
29 new(SVN::Repos::get_commit_editor($repos, "file://$repospath",
30 '/', 'root', 'FOO', \&committed));
31 my $rootbaton = $editor->open_root(0);
32 my $dirbaton = $editor->add_directory ('trunk', $rootbaton, undef, 0);
33 my $fbaton = $editor->add_file ('trunk/filea', $dirbaton, undef, -1);
34 my $ret = $editor->apply_textdelta ($fbaton, undef);
35 SVN::TxDelta::send_string("FILEA CONTENT", @$ret);
36 $editor->close_edit();
37 eval {
38 my $pool = SVN::Pool->new_default;
39 SVN::Repos::dir_delta ($fs->revision_root (0), '/', '',
40 $fs->revision_root (1), '/',
41 MyEditor->new (crap => bless {}, 'something'),
42 undef, 1, 1, 0, 0);
44 ok ($main::something_destroyed, 'editor');
46 package something;
48 sub DESTROY {
49 $main::something_destroyed++;