X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/b30cacdf8da07f40af03f1b26021d8ec4d8b8b4c..eb64d58726a65e51915f471181e734455dc19c28:/t/cvs.t?ds=inline diff --git a/t/cvs.t b/t/cvs.t index d9b9ec48e..6acafd701 100755 --- a/t/cvs.t +++ b/t/cvs.t @@ -1,9 +1,11 @@ #!/usr/bin/perl use warnings; use strict; -use Test::More; my $total_tests = 71; +use Test::More; my $total_tests = 72; use IkiWiki; +my $installed = $ENV{INSTALLED_TESTS}; + my $default_test_methods = '^test_*'; my @required_programs = qw( cvs @@ -388,6 +390,12 @@ sub test_rcs_diff { @changes = IkiWiki::rcs_recentchanges(3); is_total_number_of_changes(\@changes, 1); + unlike( + $changes[0]->{pages}->[0]->{diffurl}, + qr/%2F/m, + q{path separators are preserved when UTF-8scaping filename}, + ); + my $changeset = 1; my $maxlines = undef; @@ -573,6 +581,7 @@ sub _generate_test_config { $config{cvsrepo} = "$dir/repo"; $config{cvspath} = "ikiwiki"; use Cwd; $config{templatedir} = getcwd() . '/templates'; + $config{diffurl} = "/nonexistent/cvsweb/[[file]]"; IkiWiki::loadplugins(); IkiWiki::checkconfig(); } @@ -599,12 +608,14 @@ sub _generate_and_configure_post_commit_hook { $config{wrapper} = $config{cvs_wrapper}; require IkiWiki::Wrapper; - { - no warnings 'once'; - $IkiWiki::program_to_wrap = 'ikiwiki.out'; - # XXX substitute its interpreter to Makefile's $(PERL) - # XXX best solution: do this to all scripts during build + if ($installed) { + $IkiWiki::program_to_wrap = `which ikiwiki`; + } + else { + $IkiWiki::program_to_wrap = './ikiwiki.out'; } + # XXX substitute its interpreter to Makefile's $(PERL) + # XXX best solution: do this to all scripts during build IkiWiki::gen_wrapper(); my $cvs = "cvs -d $config{cvsrepo}"; @@ -697,5 +708,5 @@ sub stripext { } sub _wrapper_paths { - return qq{newenviron[i++]="PERL5LIB=$ENV{PERL5LIB}";}; + return qq{addenv("PERL5LIB", "$ENV{PERL5LIB}");}; }