#!/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

samples=$srcdir/htdocs/htmlhref

#
# Basic tests on all tags recognized by the parser
#
Hframe() {
t_htmlhref -h -f $samples/frame.html
}

Harea() {
t_htmlhref -h -f $samples/area.html
}

Hmeta() {
t_htmlhref -h -f $samples/meta.html
}

Hbase() {
t_htmlhref -h -f $samples/base.html
}

Ha() {
t_htmlhref -h -f $samples/a.html
}

Himg() {
t_htmlhref -h -f $samples/img.html
}

Hscript() {
t_htmlhref -h -f $samples/script.html
}

Hstyle() {
t_htmlhref -h -f $samples/style.html
}

Hescape() {
#
# Url contains &#...; sequences that must be normalized
#
t_htmlhref -h -f $samples/escape.html
}

#
# Test options
#
Hstrip_relative() {
t_htmlhref -h -a -f $samples/strip_relative.html
}

Hignore() {
t_htmlhref -i HTML_URI_BASE,HTML_URI_IMG -h -f $samples/ignore.html
}

#
# Test badly formated files
#
Hcomment() {
#
# Catch up on unfinished comment
#
t_htmlhref -h -f $samples/comment.html

#
# Comments strangely formated. <base ...> within
# comment.
#
t_htmlhref -h -f $samples/comment1.html
}

Hmany() {
#
# A lot of href, to make sure there is no 
# obvious memory leak problem.
#
t_htmlhref -h -f $samples/many.html
}

Hnewline() {
#
# Newline within URL, must be ignored
#
t_htmlhref -h -f $samples/newline.html
}

Hhairy() {
#
# The href has a lot of atributes, quite long.
#
t_htmlhref -h -f $samples/hairy.html
}

Hunfinished() {
#
# Many unfinished tags, cope with it
#
t_htmlhref -h -f $samples/unfinished.html
}

Hbench() {
t_htmlhref -Q -B 10000 -h -f $samples/many.html
}

testing ${*:-"Hframe Harea Hmeta Hbase Ha Himg Hscript Hescape Hstrip_relative Hignore Hcomment Hmany Hnewline Hhairy"}
