linkparse.txt 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595
  1. Num Tests: 73
  2. OpenID link parsing test cases
  3. Copyright (C) 2005-2008, JanRain, Inc.
  4. See COPYING for license information.
  5. File format
  6. -----------
  7. All text before the first triple-newline (this chunk) should be ignored.
  8. This file may be interpreted as Latin-1 or UTF-8.
  9. Test cases separated by three line separators (`\n\n\n'). The test
  10. cases consist of a headers section followed by a data block. These are
  11. separated by a double newline. The headers consist of the header name,
  12. followed by a colon, a space, the value, and a newline. There must be
  13. one, and only one, `Name' header for a test case. There may be zero or
  14. more link headers. The `Link' header consists of whitespace-separated
  15. attribute pairs. A link header with an empty string as a value
  16. indicates an empty but present link tag. The attribute pairs are `='
  17. separated and not quoted.
  18. Optional Links and attributes have a trailing `*'. A compilant
  19. implementation may produce this as output or may not. A compliant
  20. implementation will not produce any output that is absent from this
  21. file.
  22. Name: Well-formed link rel (in CAPS)
  23. Link: rel=openid.server href=http://www.myopenid.com/server
  24. <HTML>
  25. <HEAD>
  26. <LINK REL="openid.server"
  27. HREF="http://www.myopenid.com/server" />
  28. </HEAD>
  29. </HTML>
  30. Name: No link tag at all
  31. <html>
  32. <head>
  33. </head>
  34. </html>
  35. Name: Link element first
  36. <link>
  37. Name: Link inside HTML, not head
  38. <html>
  39. <link>
  40. Name: Link inside head, not html
  41. <head>
  42. <link>
  43. Name: Link inside html, after head
  44. <html>
  45. <head>
  46. </head>
  47. <link>
  48. Name: Link inside html, before head
  49. <html>
  50. <link>
  51. <head>
  52. Name: Link before html and head
  53. <link>
  54. <html>
  55. <head>
  56. Name: Link after html document with head
  57. <html>
  58. <head>
  59. </head>
  60. </html>
  61. <link>
  62. Name: Link inside html inside head, inside another html
  63. <html>
  64. <head>
  65. <html>
  66. <link>
  67. Name: Link inside html inside head
  68. <head>
  69. <html>
  70. <link>
  71. Name: link inside body inside head inside html
  72. <html>
  73. <head>
  74. <body>
  75. <link>
  76. Name: Link inside head inside head inside html
  77. <html>
  78. <head>
  79. <head>
  80. <link>
  81. Name: Link inside script inside head inside html
  82. <html>
  83. <head>
  84. <script>
  85. <link>
  86. </script>
  87. Name: Link inside comment inside head inside html
  88. <html>
  89. <head/>
  90. <link>
  91. Name: Link inside of head after short head
  92. <html>
  93. <head/>
  94. <head>
  95. <link>
  96. Name: Plain vanilla
  97. Link:
  98. <html>
  99. <head>
  100. <link>
  101. Name: Ignore tags in the <script:... > namespace
  102. Link*:
  103. <html>
  104. <head>
  105. <script:paddypan>
  106. <link>
  107. </script:paddypan>
  108. Name: Short link tag
  109. Link:
  110. <html>
  111. <head>
  112. <link/>
  113. Name: Spaces in the HTML tag
  114. Link:
  115. <html >
  116. <head>
  117. <link>
  118. Name: Spaces in the head tag
  119. Link:
  120. <html>
  121. <head >
  122. <link>
  123. Name: Spaces in the link tag
  124. Link:
  125. <html>
  126. <head>
  127. <link >
  128. Name: No whitespace
  129. Link:
  130. <html><head><link>
  131. Name: Closed head tag
  132. Link:
  133. <html>
  134. <head>
  135. <link>
  136. </head>
  137. Name: One good, one bad (after close head)
  138. Link:
  139. <html>
  140. <head>
  141. <link>
  142. </head>
  143. <link>
  144. Name: One good, one bad (after open body)
  145. Link:
  146. <html>
  147. <head>
  148. <link>
  149. <body>
  150. <link>
  151. Name: ill formed (missing close head)
  152. Link:
  153. <html>
  154. <head>
  155. <link>
  156. </html>
  157. Name: Ill formed (no close head, link after </html>)
  158. Link:
  159. <html>
  160. <head>
  161. <link>
  162. </html>
  163. <link>
  164. Name: Ignore random tags inside of html
  165. Link:
  166. <html>
  167. <delicata>
  168. <head>
  169. <title>
  170. <link>
  171. Name: case-folding
  172. Link*:
  173. <HtMl>
  174. <hEaD>
  175. <LiNk>
  176. Name: unexpected tags
  177. Link:
  178. <butternut>
  179. <html>
  180. <summer>
  181. <head>
  182. <turban>
  183. <link>
  184. Name: un-closed script tags
  185. Link*:
  186. <html>
  187. <head>
  188. <script>
  189. <link>
  190. Name: un-closed script tags (no whitespace)
  191. Link*:
  192. <html><head><script><link>
  193. Name: un-closed comment
  194. Link*:
  195. <html>
  196. <head>
  197. <!--
  198. <link>
  199. Name: un-closed CDATA
  200. Link*:
  201. <html>
  202. <head>
  203. <![CDATA[
  204. <link>
  205. Name: cdata-like
  206. Link*:
  207. <html>
  208. <head>
  209. <![ACORN[
  210. <link>
  211. ]]>
  212. Name: comment close only
  213. Link:
  214. <html>
  215. <head>
  216. <link>
  217. -->
  218. Name: Vanilla, two links
  219. Link:
  220. Link:
  221. <html>
  222. <head>
  223. <link>
  224. <link>
  225. Name: extra tag, two links
  226. Link:
  227. Link:
  228. <html>
  229. <gold nugget>
  230. <head>
  231. <link>
  232. <link>
  233. Name: case-fold, body ends, two links
  234. Link:
  235. Link*:
  236. <html>
  237. <head>
  238. <link>
  239. <LiNk>
  240. <body>
  241. <link>
  242. Name: simple, non-quoted rel
  243. Link: rel=openid.server
  244. <html><head><link rel=openid.server>
  245. Name: short tag has rel
  246. Link: rel=openid.server
  247. <html><head><link rel=openid.server/>
  248. Name: short tag w/space has rel
  249. Link: rel=openid.server
  250. <html><head><link rel=openid.server />
  251. Name: extra non-attribute, has rel
  252. Link: rel=openid.server
  253. <html><head><link hubbard rel=openid.server>
  254. Name: non-attr, has rel, short
  255. Link: rel=openid.server
  256. <html><head><link hubbard rel=openid.server/>
  257. Name: non-attr, has rel, short, space
  258. Link: rel=openid.server
  259. <html><head><link hubbard rel=openid.server />
  260. Name: misplaced slash has rel
  261. Link: rel=openid.server
  262. <html><head><link / rel=openid.server>
  263. Name: quoted rel
  264. Link: rel=openid.server
  265. <html><head><link rel="openid.server">
  266. Name: single-quoted rel
  267. Link: rel=openid.server
  268. <html><head><link rel='openid.server'>
  269. Name: two links w/ rel
  270. Link: x=y
  271. Link: a=b
  272. <html><head><link x=y><link a=b>
  273. Name: non-entity
  274. Link: x=&y
  275. <html><head><link x=&y>
  276. Name: quoted non-entity
  277. Link: x=&y
  278. <html><head><link x="&y">
  279. Name: quoted entity
  280. Link: x=&
  281. <html><head><link x="&amp;">
  282. Name: entity not processed
  283. Link: x=&#26;
  284. <html><head><link x="&#26;">
  285. Name: &lt;
  286. Link: x=<
  287. <html><head><link x="&lt;">
  288. Name: &gt;
  289. Link: x=>
  290. <html><head><link x="&gt;">
  291. Name: &quot;
  292. Link: x="
  293. <html><head><link x="&quot;">
  294. Name: &amp;&quot;
  295. Link: x=&"
  296. <html><head><link x="&amp;&quot;">
  297. Name: mixed entity and non-entity
  298. Link: x=&"&hellip;>
  299. <html><head><link x="&amp;&quot;&hellip;&gt;">
  300. Name: mixed entity and non-entity (w/normal chars)
  301. Link: x=x&"&hellip;>x
  302. <html><head><link x="x&amp;&quot;&hellip;&gt;x">
  303. Name: broken tags
  304. Link*: x=y
  305. <html><head><link x=y<>
  306. Name: missing close pointy
  307. Link: z=y
  308. <html><head><link x=y<link z=y />
  309. Name: missing attribute value
  310. Link: x=y y*=
  311. Link: x=y
  312. <html><head><link x=y y=><link x=y />
  313. Name: Missing close pointy (no following)
  314. Link*: x=y
  315. <html><head><link x=y
  316. Name: Should be quoted
  317. Link: x*=<
  318. <html><head><link x="<">
  319. Name: Should be quoted (2)
  320. Link: x*=>
  321. <html><head><link x=">">
  322. Name: Repeated attribute
  323. Link: x=y
  324. <html><head><link x=z x=y>
  325. Name: Repeated attribute (2)
  326. Link: x=y
  327. <html><head><link x=y x=y>
  328. Name: Two attributes
  329. Link: x=y y=z
  330. <html><head><link x=y y=z>
  331. Name: Well-formed link rel="openid.server"
  332. Link: rel=openid.server href=http://www.myopenid.com/server
  333. <html>
  334. <head>
  335. <link rel="openid.server"
  336. href="http://www.myopenid.com/server" />
  337. </head>
  338. </html>
  339. Name: Well-formed link rel="openid.server" and "openid.delegate"
  340. Link: rel=openid.server href=http://www.myopenid.com/server
  341. Link: rel=openid.delegate href=http://example.myopenid.com/
  342. <html><head><link rel="openid.server"
  343. href="http://www.myopenid.com/server" />
  344. <link rel="openid.delegate" href="http://example.myopenid.com/" />
  345. </head></html>
  346. Name: from brian's livejournal page
  347. Link: rel=stylesheet href=http://www.livejournal.com/~serotta/res/319998/stylesheet?1130478711 type=text/css
  348. Link: rel=openid.server href=http://www.livejournal.com/openid/server.bml
  349. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  350. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  351. <html xmlns="http://www.w3.org/1999/xhtml">
  352. <head>
  353. <link rel="stylesheet"
  354. href="http://www.livejournal.com/~serotta/res/319998/stylesheet?1130478711"
  355. type="text/css" />
  356. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  357. <meta name="foaf:maker"
  358. content="foaf:mbox_sha1sum '12f8abdacb5b1a806711e23249da592c0d316260'" />
  359. <meta name="robots" content="noindex, nofollow, noarchive" />
  360. <meta name="googlebot" content="nosnippet" />
  361. <link rel="openid.server"
  362. href="http://www.livejournal.com/openid/server.bml" />
  363. <title>Brian</title>
  364. </head>
  365. Name: non-ascii (Latin-1 or UTF8)
  366. Link: x=®
  367. <html><head><link x="®">