#!/bin/sh
#
#   Copyright (C) 2001 Loic Dachary
#
#   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. 
#

. test_functions

samples_base=http://localhost:7400/
samples=http://localhost:7400/index

Cservers_basic() {
init_sql
$mysql -e "insert into start (url,url_md5) values ('http://www.foo.bar/', 1)" $testdb
$consistentc -servers -base $testdb
$mysql -e "select * from servers" $testdb
}

Cservers_re() {
init_sql
$mysql -e "insert into start (url,url_md5) values ('http://www.foo.bar/bla/bla/', 1)" $testdb
echo '
insert into home_re values ("www.foo.bar", "http://www.foo.bar/([^/]*)");
' | $mysql $testdb
$consistentc -verbose_server -servers -base $testdb
$mysql -e "select * from servers" $testdb
}

testing ${*:-"Cservers_basic Cservers_re"}
