1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
# Features covered: HTML parser
#
# This file contains a collection of tests for the HTML parser.
# Tested functionalities:
# html-1.*: Character encoding
#
# Copyright (c) 2002 Rolf Ade.
#
# RCS: @(#) $Id: htmlreader.test,v 1.6 2002/11/16 01:31:37 rolf Exp $
source [file join [file dir [info script]] loadtdom.tcl]
test html-1.1 {HTML character entities} {need_i18n} {
set doc [dom parse -html {<html><body> ¡Äü</body></html>}]
set root [$doc documentElement]
set body [$root firstChild]
set result [$body text]
$doc delete
set result
} "\u00A0\u00A1\u00c4\u00fc"
test html-1.2 {character entities} {need_i18n} {
set doc [dom parse -html {<html><body>ÖÄÄ</body></html>}]
set root [$doc documentElement]
set body [$root firstChild]
set result [$body text]
$doc delete
set result
} "\u00d6\u00c4\u00c4"
test html-1.3 {character entities} {need_i18n} {
set doc [dom parse -html {<html>€∋</html>}]
set root [$doc documentElement]
set result [$root text]
$doc delete
set result
} "\u20ac\u220b"
# cleanup
::tcltest::cleanupTests
return
|