Update of /cvsroot/lxr/lxr/tests
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv10711/tests
Modified Files:
PlainTest.pm
Log Message:
Part II of Bug 2750080 (Running the Tests Outputs Warnings) - added test src files and updated PlainTest::test_getfile() to use them so that this test now works properly
Index: PlainTest.pm
===================================================================
RCS file: /cvsroot/lxr/lxr/tests/PlainTest.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- PlainTest.pm 2 Nov 2005 23:39:55 -0000 1.2
+++ PlainTest.pm 10 Apr 2009 20:29:59 -0000 1.3
@@ -4,6 +4,8 @@
package PlainTest;
use strict;
+use FindBin;
+
use Test::Unit;
use lib "..";
use lib "../lib";
@@ -16,7 +18,7 @@
use vars qw($root);
-$root = "/Users/malcolmbox/dev/lxr-src/";
+$root = "$FindBin::Bin/test-src/";
$config = new LXR::Config("http://test/lxr", "./lxr.conf");
@@ -53,7 +55,7 @@
$self->assert_deep_equals(\@files, \@files2);
# Check for invalid behaviours
- @files = $f->getdir("/COPYING", '5.5.4');
+ @files = $f->getdir("/aFile.txt", '5.5.4');
$self->assert($#files == -1);
@files = $f->getdir("tests", '5.5.4');
$self->assert($#files == -1);
@@ -67,9 +69,9 @@
my $self = shift;
my $f = $self->{'plain'};
- my $file = $f->getfile("/COPYING", '5.5.4');
+ my $file = $f->getfile("/aFile.txt", '5.5.4');
local ($/) = undef;
- open FILE, "<". "$root/5.5.4/COPYING" || die "Can't open file";
+ open FILE, "<". "$root/5.5.4/aFile.txt" || die "Can't open file";
my $ref = <FILE>;
$self->assert($file eq $ref, "Files not matching");
}
|