#!/bin/sh
#
#   Copyright (C) 1997, 1998
#   	Free Software Foundation, Inc.
#
#   This program is free software; you can redistribute it and/or modify it
#   under the terms of the GNU General Public License as published by the
#   Free Software Foundation; either version 2, or (at your option) any
#   later version.
#
#   This program is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#   GNU General Public License for more details.
#
#   You should have received a copy of the GNU General Public License
#   along with this program; if not, write to the Free Software
#   Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 
#

. $srcdir/test_functions

if [ "$mifluz" != "yes" ]
then
    exit 77
fi

samples=http://localhost:7400/index

Iinsert() {
init_sql
#
# Only one URL is crawled and it contains only a few words
#
$crawler -base $testdb -robot_delay 0 $samples/simple.html
}

Irebuild() {
init_sql
$crawler -base $testdb -robot_delay 0 $samples/simple.html
db_dump -p inverted > /tmp/1$$
$crawler -base $testdb -rebuild
db_dump -p inverted > /tmp/2$$
diff /tmp/[12]$$
rm -f /tmp/[12]$$
}

Iiso8859() {
init_sql
$crawler -base $testdb -robot_delay 0 $samples/iso8859-1.html
db_dump -p inverted | sed -n 's/.*\(seance\)/\1/p'
}

testing ${*:-"Iinsert Irebuild Iiso8859"}
