#!/usr/bin/perl package bookfinder; use Test::More tests=>3; use strict; use warnings; require "index.cgi"; is(0, scalar get_book(), "0 books in the beginning"); my @books = qw ( lang/aa.chm lang/bb.pdf misc/cc.txt ); add_search_pattern('aa'); find_book() for @books; my @one_book_found = get_book(); is(scalar @one_book_found, 1, "1 book found"); is($one_book_found[0], qq{lang/aa.chm}, "The first book name");