[Lxr-commits] CVS: lxr/tests lxr.conf,1.1.4.1,1.1.4.2 ConfigTest.pm,1.2.2.1,1.2.2.2
Brought to you by:
ajlittoz
From: Malcolm B. <mb...@us...> - 2005-02-21 00:07:10
|
Update of /cvsroot/lxr/lxr/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17503/tests Modified Files: Tag: bk-dev-branch lxr.conf ConfigTest.pm Log Message: Tests for new 'sourceparams' config directive, and fix for typo in usage Index: lxr.conf =================================================================== RCS file: /cvsroot/lxr/lxr/tests/lxr.conf,v retrieving revision 1.1.4.1 retrieving revision 1.1.4.2 diff -u -d -r1.1.4.1 -r1.1.4.2 --- lxr.conf 13 Feb 2005 19:35:04 -0000 1.1.4.1 +++ lxr.conf 21 Feb 2005 00:07:00 -0000 1.1.4.2 @@ -92,7 +92,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> Index: ConfigTest.pm =================================================================== RCS file: /cvsroot/lxr/lxr/tests/ConfigTest.pm,v retrieving revision 1.2.2.1 retrieving revision 1.2.2.2 diff -u -d -r1.2.2.1 -r1.2.2.2 --- ConfigTest.pm 4 Dec 2004 23:31:15 -0000 1.2.2.1 +++ ConfigTest.pm 21 Feb 2005 00:07:00 -0000 1.2.2.2 @@ -52,6 +52,17 @@ $self->assert($#vars == 1, "Too many variables returned got @vars"); } +# 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 { |