--- /dev/null
+# $Id: tests.tcl,v 1.1 2001/11/08 14:22:21 adam Exp $
+proc testhref {} {
+ global URL
+
+ foreach testref {
+ {../../k.htm /k.htm}
+ {../k.htm /k.htm}
+ {.././k.htm /k.htm}
+ {./../k.htm /k.htm}
+ {k.htm /k.htm}
+ {./k.htm /k.htm}
+ {/../k.htm /k.htm}
+ {/./../.././k.htm /k.htm}
+ {../../peter/k.htm /peter/k.htm}
+ {../../ /}
+ {/// /}
+ {../.. /}} {
+ set URL(t,hostport) http://bilbasen.tv2.dk
+ set URL(t,path) /
+ set href [lindex $testref 0]
+ puts -nonewline "testing href=$href "
+ RobotHref t href host path
+ if {[string compare $path [lindex $testref 1]]} {
+ puts "failed"
+ puts " href=$href"
+ puts " host=$host"
+ puts " path=$path"
+ } else {
+ puts "OK"
+ }
+ }
+ foreach testref {
+ {../../k.htm /k.htm}
+ {../k.htm /k.htm}
+ {.././k.htm /k.htm}
+ {./../k.htm /k.htm}
+ {k.htm /k.htm}
+ {./k.htm /k.htm}
+ {/../k.htm /k.htm}
+ {/./../.././k.htm /k.htm}
+ {../../peter/k.htm /peter/k.htm}
+ {../../ /}
+ {../.. /}} {
+ set URL(t,hostport) http://bilbasen.tv2.dk
+ set URL(t,path) /not_good.asp
+ set href [lindex $testref 0]
+ puts -nonewline "testing href=$href "
+ RobotHref t href host path
+ if {[string compare $path [lindex $testref 1]]} {
+ puts "failed"
+ puts " href=$href"
+ puts " host=$host"
+ puts " path=$path"
+ } else {
+ puts "OK"
+ }
+ }
+ foreach testref {
+ {../../k.htm /k.htm}
+ {../k.htm /k.htm}
+ {k.htm /pages/k.htm}
+ {../../peter/k.htm /peter/k.htm}
+ {../../ /}
+ {/../k.htm /k.htm}
+ {/./../.././k.htm /k.htm}
+ {../.. /}} {
+ set URL(t,hostport) http://bilbasen.tv2.dk
+ set URL(t,path) /pages/not_good.asp
+ set href [lindex $testref 0]
+ puts -nonewline "testing href=$href "
+ RobotHref t href host path
+ if {[string compare $path [lindex $testref 1]]} {
+ puts "failed"
+ puts " href=$href"
+ puts " host=$host"
+ puts " path=$path"
+ } else {
+ puts "OK"
+ }
+ }
+ foreach testref {
+ {../../k.htm /k.htm}
+ {../k.htm /k.htm}
+ {k.htm /pages/k.htm}
+ {../../peter/k.htm /peter/k.htm}
+ {../../ /}
+ {../.. /}} {
+ set URL(t,hostport) http://bilbasen.tv2.dk
+ set URL(t,path) /pages/
+ set href [lindex $testref 0]
+ puts -nonewline "testing href=$href "
+ RobotHref t href host path
+ if {[string compare $path [lindex $testref 1]]} {
+ puts "failed"
+ puts " href=$href"
+ puts " host=$host"
+ puts " path=$path"
+ } else {
+ puts "OK"
+ }
+ }
+}
+
+testhref
+
+exit 0
+
+