[Lxr-commits] CVS: lxr/tests BKTest.pm,1.1,1.2 PlainTest.pm,1.1,1.2 AllTests.pm,1.2,1.3 ConfigTest.p
Brought to you by:
ajlittoz
From: Malcolm B. <mb...@us...> - 2005-11-02 23:40:04
|
Update of /cvsroot/lxr/lxr/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15203/tests Modified Files: AllTests.pm ConfigTest.pm lxr.conf Added Files: BKTest.pm PlainTest.pm Log Message: Merge of the BK support from bk-dev-branch. This merge closes the bk-dev-branch. Adds support for BK repositories (somewhat incomplete). As BK is no longer free, this is untestable by the maintainer and will therefore not be maintained. It is released here to allow others to take it forward if they want. Also updates and add new testcases. Index: AllTests.pm =================================================================== RCS file: /cvsroot/lxr/lxr/tests/AllTests.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- AllTests.pm 4 May 2005 23:21:09 -0000 1.2 +++ AllTests.pm 2 Nov 2005 23:39:55 -0000 1.3 @@ -16,7 +16,8 @@ $suite->add_test(Test::Unit::TestSuite->new("ConfigTest")); $suite->add_test(Test::Unit::TestSuite->new("SecurityTest")); $suite->add_test(Test::Unit::TestSuite->new("CVSTest")); - + $suite->add_test(Test::Unit::TestSuite->new("PlainTest")); +# $suite->add_test(Test::Unit::TestSuite->new("BKTest")); return $suite; } Index: ConfigTest.pm =================================================================== RCS file: /cvsroot/lxr/lxr/tests/ConfigTest.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- ConfigTest.pm 10 Sep 2005 00:09:20 -0000 1.3 +++ ConfigTest.pm 2 Nov 2005 23:39:55 -0000 1.4 @@ -49,7 +49,7 @@ my @vars = $self->{config}->allvariables(); $self->assert(grep {$_ eq 'v'} @vars, "allvariables didn't return v"); $self->assert(grep {$_ eq 'a'} @vars, "allvariables didn't return a"); - $self->assert($#vars == 1, "Too many variables returned got " . $self->{config}->allvariables()); + $self->assert($#vars == 1, "Too many variables returned got @vars"); } sub test_config_error { @@ -62,6 +62,25 @@ $self->assert_matches(qr/--url parameter should be a URL \(e\.g\. http:/, $t); } +# Test access to the sourceparams section + +sub test_sourceparams { + my $self = shift; + my $config = $self->{'config'}; + + my $params = $config->sourceparams; + $self->assert_equals($$params{'cachepath'}, '/a/path/to/cache'); + $self->assert_equals($$params{'param2'}, 'secondparam'); +} + +# Test multiple config block with common substrings work +# Bug 525825 +sub test_multi_config { + my $self = shift; + my $test = eval {new LXR::Config("http://test/lxr-wibble", "./lxr.conf");}; + $self->assert(!defined($test), "Should not have matched"); + } + # set_up and tear_down are used to # prepare and release resources need for testing Index: lxr.conf =================================================================== RCS file: /cvsroot/lxr/lxr/tests/lxr.conf,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- lxr.conf 4 May 2005 23:21:09 -0000 1.2 +++ lxr.conf 2 Nov 2005 23:39:55 -0000 1.3 @@ -95,7 +95,7 @@ # The name to display for this source tree 'sourcerootname' => 'Example', - + 'sourceparams' => {'cachepath' => '/a/path/to/cache', 'param2' => 'secondparam'}, # The DBI identifier for the database to use # For mysql, the format is dbi:mysql:dbname=<name> # for Postgres, it is dbi:Pg:dbname=<name> @@ -177,7 +177,8 @@ # ['tcl', '(?i)\.tcl$|\.wish$' #' # , 'LXR::Lang::Generic'], }, - + + 'ignoredirs' => [], # Maps interpreter names to languages. The format is: # regexp => langname # regexp is matched against the part after #! on the first line of a file |