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 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181
|
#
# Test script for the Tk HTML widget
#
wm withdraw .
if {[lsearch [namespace children] ::tcltest] == -1} {
source [file dirname $argv0]/engine.tcl
namespace import ::tcltest::*
}
::tcltest::test html-1.0 {
Verify that all of the entites are displayed correctly.
} {
set h [tkhtml_test_widget]
$h clear
$h parse {
<html>
<h1>Entity and special character test</h1>
<p>The following list shows each entity of HTML 3.2 in four
formats: (1) the name, (2) as &entity;, (3) as &#123;, and
(4) as a raw UTF-8 or Ascii character.</p>
<ul>
<li> quot " " " </li>
<li> amp & & & </li>
<li> lt < < < </li>
<li> gt > > > </li>
<li> nbsp   </li>
<li> iexcl ¡ ¡ </li>
<li> cent ¢ ¢ </li>
<li> pound £ £ </li>
<li> curren ¤ ¤ </li>
<li> yen ¥ ¥ </li>
<li> brvbar ¦ ¦ </li>
<li> sect § § </li>
<li> uml ¨ ¨ </li>
<li> copy © © </li>
<li> ordf ª ª </li>
<li> laquo « « </li>
<li> not ¬ ¬ </li>
<li> shy ­ ­ </li>
<li> reg ® ® </li>
<li> macr ¯ ¯ </li>
<li> deg ° ° </li>
<li> plusmn ± ± </li>
<li> sup2 ² ² </li>
<li> sup3 ³ ³ </li>
<li> acute ´ ´ </li>
<li> micro µ µ </li>
<li> para ¶ ¶ </li>
<li> middot · · </li>
<li> cedil ¸ ¸ </li>
<li> sup1 ¹ ¹ </li>
<li> ordm º º </li>
<li> raquo » » </li>
<li> frac14 ¼ ¼ </li>
<li> frac12 ½ ½ </li>
<li> frac34 ¾ ¾ </li>
<li> iquest ¿ ¿ </li>
<li> Agrave À À </li>
<li> Aacute Á Á </li>
<li> Acirc   </li>
<li> Atilde à à </li>
<li> Auml Ä Ä </li>
<li> Aring Å Å </li>
<li> AElig Æ Æ </li>
<li> Ccedil Ç Ç </li>
<li> Egrave È È </li>
<li> Eacute É É </li>
<li> Ecirc Ê Ê </li>
<li> Euml Ë Ë </li>
<li> Igrave Ì Ì </li>
<li> Iacute Í Í </li>
<li> Icirc Î Î </li>
<li> Iuml Ï Ï </li>
<li> ETH Ð Ð </li>
<li> Ntilde Ñ Ñ </li>
<li> Ograve Ò Ò </li>
<li> Oacute Ó Ó </li>
<li> Ocirc Ô Ô </li>
<li> Otilde Õ Õ </li>
<li> Ouml Ö Ö </li>
<li> times × × </li>
<li> Oslash Ø Ø </li>
<li> Ugrave Ù Ù </li>
<li> Uacute Ú Ú </li>
<li> Ucirc Û Û </li>
<li> Uuml Ü Ü </li>
<li> Yacute Ý Ý </li>
<li> THORN Þ Þ </li>
<li> szlig ß ß </li>
<li> agrave à à </li>
<li> aacute á á </li>
<li> acirc â â </li>
<li> atilde ã ã </li>
<li> auml ä ä </li>
<li> aring å å </li>
<li> aelig æ æ </li>
<li> ccedil ç ç </li>
<li> egrave è è </li>
<li> eacute é é </li>
<li> ecirc ê ê </li>
<li> euml ë ë </li>
<li> igrave ì ì </li>
<li> iacute í í </li>
<li> icirc î î </li>
<li> iuml ï ï </li>
<li> eth ð ð </li>
<li> ntilde ñ ñ </li>
<li> ograve ò ò </li>
<li> oacute ó ó </li>
<li> ocirc ô ô </li>
<li> otilde õ õ </li>
<li> ouml ö ö </li>
<li> divide ÷ ÷ </li>
<li> oslash ø ø </li>
<li> ugrave ù ù </li>
<li> uacute ú ú </li>
<li> ucirc û û </li>
<li> uuml ü ü </li>
<li> yacute ý ý </li>
<li> thorn þ þ </li>
<li> yuml ÿ ÿ </li>
</ul>
</html>
}
::tcltest::user-result
} {0 pass}
::tcltest::test html-1.1 {
Verify that all subscripting and superscripting works.
} {
set h [tkhtml_test_widget]
$h clear
$h parse {
<html>
<body>
<h1>A test of subscripting and superscripting</h1>
<p>Here is sub<sub>script</sub>. And now super<sup>script</sup>.</p>
<p>Here is sub<sub>sub<sub>script</sub></sub>.
And now super<sup>super<sup>script</sup></sup>.</p>
<p>Here is sub<sub>super<sup>script</sup></sub></p>
</body>
</html>
}
::tcltest::user-result
} {0 pass}
::tcltest::test html-1.2 {
Verify stylistic markup.
} {
set h [tkhtml_test_widget]
$h clear
$h parse {
<html>
<body>
<h1>A test of font changing markup</h1>
<p>This is normal text</p>
<p><b>: <b>bold text</b></p>
<p><big>: <big>big text</big></p>
<p><cite>: <cite>cite text</cite></p>
<p><code>: <code>code text</code></p>
<p><em>: <em>emphasized text</em></p>
<p><i>: <i>italic text</i></p>
<p><kbd>: <kbd>keyboard text</kbd></p>
<p><s>: <s>strike-thru text</s></p>
<p><samp>: <samp>sample text</samp></p>
<p><small>: <small>small text</small></p>
<p><strike>: <strike>strike-thru text</strike></p>
<p><strong>: <strong>strong text</strong></p>
<p><tt>: <tt>teletype text</tt></p>
<p><u>: <u>underlined text</u></p>
<p><var>: <var>variable text</var></p>
<p>This is normal text</p>
</body>
</html>
}
::tcltest::user-result
} {0 pass}
|