3 OpenID link parsing test cases
4 Copyright (C) 2005-2008, JanRain, Inc.
5 See COPYING for license information.
10 All text before the first triple-newline (this chunk) should be ignored.
12 This file may be interpreted as Latin-1 or UTF-8.
14 Test cases separated by three line separators (`\n\n\n'). The test
15 cases consist of a headers section followed by a data block. These are
16 separated by a double newline. The headers consist of the header name,
17 followed by a colon, a space, the value, and a newline. There must be
18 one, and only one, `Name' header for a test case. There may be zero or
19 more link headers. The `Link' header consists of whitespace-separated
20 attribute pairs. A link header with an empty string as a value
21 indicates an empty but present link tag. The attribute pairs are `='
22 separated and not quoted.
24 Optional Links and attributes have a trailing `*'. A compilant
25 implementation may produce this as output or may not. A compliant
26 implementation will not produce any output that is absent from this
30 Name: No link tag at all
38 Name: Link element first
43 Name: Link inside HTML, not head
49 Name: Link inside head, not html
55 Name: Link inside html, after head
63 Name: Link inside html, before head
70 Name: Link before html and head
77 Name: Link after html document with head
86 Name: Link inside html inside head, inside another html
94 Name: Link inside html inside head
101 Name: link inside body inside head inside html
109 Name: Link inside head inside head inside html
117 Name: Link inside script inside head inside html
126 Name: Link inside comment inside head inside html
133 Name: Link inside of head after short head
149 Name: Ignore tags in the <script:... > namespace
167 Name: Spaces in the HTML tag
175 Name: Spaces in the head tag
183 Name: Spaces in the link tag
197 Name: Closed head tag
206 Name: One good, one bad (after close head)
216 Name: One good, one bad (after open body)
226 Name: ill formed (missing close head)
235 Name: Ill formed (no close head, link after </html>)
245 Name: Ignore random tags inside of html
263 Name: unexpected tags
274 Name: un-closed script tags
283 Name: un-closed script tags (no whitespace)
286 <html><head><script><link>
289 Name: un-closed comment
298 Name: un-closed CDATA
317 Name: comment close only
326 Name: Vanilla, two links
336 Name: extra tag, two links
347 Name: case-fold, body ends, two links
359 Name: simple, non-quoted rel
360 Link: rel=openid.server
362 <html><head><link rel=openid.server>
365 Name: short tag has rel
366 Link: rel=openid.server
368 <html><head><link rel=openid.server/>
371 Name: short tag w/space has rel
372 Link: rel=openid.server
374 <html><head><link rel=openid.server />
377 Name: extra non-attribute, has rel
378 Link: rel=openid.server
380 <html><head><link hubbard rel=openid.server>
383 Name: non-attr, has rel, short
384 Link: rel=openid.server
386 <html><head><link hubbard rel=openid.server/>
389 Name: non-attr, has rel, short, space
390 Link: rel=openid.server
392 <html><head><link hubbard rel=openid.server />
395 Name: misplaced slash has rel
396 Link: rel=openid.server
398 <html><head><link / rel=openid.server>
402 Link: rel=openid.server
404 <html><head><link rel="openid.server">
407 Name: single-quoted rel
408 Link: rel=openid.server
410 <html><head><link rel='openid.server'>
413 Name: two links w/ rel
417 <html><head><link x=y><link a=b>
423 <html><head><link x=&y>
426 Name: quoted non-entity
429 <html><head><link x="&y">
435 <html><head><link x="&">
438 Name: entity not processed
441 <html><head><link x="">
447 <html><head><link x="<">
453 <html><head><link x=">">
459 <html><head><link x=""">
465 <html><head><link x="&"">
468 Name: mixed entity and non-entity
471 <html><head><link x="&"…>">
474 Name: mixed entity and non-entity (w/normal chars)
475 Link: x=x&"…>x
477 <html><head><link x="x&"…>x">
483 <html><head><link x=y<>
486 Name: missing close pointy
490 <html><head><link x=y<link z=y />
493 Name: missing attribute value
497 <html><head><link x=y y=><link x=y />
500 Name: Missing close pointy (no following)
503 <html><head><link x=y
506 Name: Should be quoted
509 <html><head><link x="<">
512 Name: Should be quoted (2)
515 <html><head><link x=">">
518 Name: Repeated attribute
521 <html><head><link x=z x=y>
524 Name: Repeated attribute (2)
527 <html><head><link x=y x=y>
533 <html><head><link x=y y=z>
536 Name: Well-formed link rel="openid.server"
537 Link: rel=openid.server href=http://www.myopenid.com/server
541 <link rel="openid.server"
542 href="http://www.myopenid.com/server" />
547 Name: Well-formed link rel="openid.server" and "openid.delegate"
548 Link: rel=openid.server href=http://www.myopenid.com/server
549 Link: rel=openid.delegate href=http://example.myopenid.com/
551 <html><head><link rel="openid.server"
552 href="http://www.myopenid.com/server" />
553 <link rel="openid.delegate" href="http://example.myopenid.com/" />
557 Name: from brian's livejournal page
558 Link: rel=stylesheet href=http://www.livejournal.com/~serotta/res/319998/stylesheet?1130478711 type=text/css
559 Link: rel=openid.server href=http://www.livejournal.com/openid/server.bml
561 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
562 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
563 <html xmlns="http://www.w3.org/1999/xhtml">
565 <link rel="stylesheet"
566 href="http://www.livejournal.com/~serotta/res/319998/stylesheet?1130478711"
568 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
569 <meta name="foaf:maker"
570 content="foaf:mbox_sha1sum '12f8abdacb5b1a806711e23249da592c0d316260'" />
571 <meta name="robots" content="noindex, nofollow, noarchive" />
572 <meta name="googlebot" content="nosnippet" />
573 <link rel="openid.server"
574 href="http://www.livejournal.com/openid/server.bml" />
579 Name: non-ascii (Latin-1 or UTF8)
582 <html><head><link x="®">