diff options
author | Kato Kazuyoshi <kato.kazuyoshi@gmail.com> | 2014-08-12 21:20:39 +0900 |
---|---|---|
committer | Kato Kazuyoshi <kato.kazuyoshi@gmail.com> | 2014-08-13 22:10:19 +0900 |
commit | 131dea0810f75292da3b4fcf420d035cc59ac873 (patch) | |
tree | 4df51b10ffde1caedaf1a34fb7c8f7324c44ddd3 /test/scaladoc/scalacheck | |
parent | b8deaa11cba964f686e33fe416758989df0f31eb (diff) | |
download | scala-131dea0810f75292da3b4fcf420d035cc59ac873.tar.gz scala-131dea0810f75292da3b4fcf420d035cc59ac873.tar.bz2 scala-131dea0810f75292da3b4fcf420d035cc59ac873.zip |
Scaladoc: the value of an id attribute must be unique within a document
The value of an id attribute must be unique, according to HTML spec.
Diffstat (limited to 'test/scaladoc/scalacheck')
-rw-r--r-- | test/scaladoc/scalacheck/HtmlFactoryTest.scala | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/test/scaladoc/scalacheck/HtmlFactoryTest.scala b/test/scaladoc/scalacheck/HtmlFactoryTest.scala index ef70e0bf21..fdc4f9527f 100644 --- a/test/scaladoc/scalacheck/HtmlFactoryTest.scala +++ b/test/scaladoc/scalacheck/HtmlFactoryTest.scala @@ -778,6 +778,11 @@ object Test extends Properties("HtmlFactory") { linkElement \@ "href" == expectedUrl && linkElement \@ "target" == "_top" } + def assertValuesLink(memberName: String, expectedUrl: String): Boolean = { + val linkElement: NodeSeq = node \\ "div" \@ ("class", "values members") \\ "li" \@ ("name", memberName) \\ "span" \@ ("class", "permalink") \ "a" + linkElement \@ "href" == expectedUrl && linkElement \@ "target" == "_top" + } + } val files = createTemplates("SI-8144.scala") @@ -790,12 +795,12 @@ object Test extends Properties("HtmlFactory") { property("SI-8144: Members' permalink - package") = check("some/package.html") { node => ("type link" |: node.assertTypeLink("../index.html#some.package")) && - ("member: some.pack" |: node.assertMemberLink("values")("some.pack", "../index.html#some.package@pack")) + ("member: some.pack" |: node.assertValuesLink("some.pack", "../index.html#some.package@pack")) } property("SI-8144: Members' permalink - inner package") = check("some/pack/package.html") { node => ("type link" |: node.assertTypeLink("../../index.html#some.pack.package")) && - ("member: SomeType (object)" |: node.assertMemberLink("values")("some.pack.SomeType", "../../index.html#some.pack.package@SomeType")) && + ("member: SomeType (object)" |: node.assertValuesLink("some.pack.SomeType", "../../index.html#some.pack.package@SomeType")) && ("member: SomeType (class)" |: node.assertMemberLink("types")("some.pack.SomeType", "../../index.html#some.pack.package@SomeTypeextendsAnyRef")) } @@ -808,8 +813,8 @@ object Test extends Properties("HtmlFactory") { ("type link" |: node.assertTypeLink("../../index.html#some.pack.SomeType")) && ("constructor " |: node.assertMemberLink("constructors")("some.pack.SomeType#<init>", "../../index.html#some.pack.SomeType@<init>(arg:String):some.pack.SomeType")) && ( "member: type TypeAlias" |: node.assertMemberLink("types")("some.pack.SomeType.TypeAlias", "../../index.html#some.pack.SomeType@TypeAlias=String")) && - ( "member: def >#<():Int " |: node.assertMemberLink("values")("some.pack.SomeType#>#<", "../../index.html#some.pack.SomeType@>#<():Int")) && - ( "member: def >@<():TypeAlias " |: node.assertMemberLink("values")("some.pack.SomeType#>@<", "../../index.html#some.pack.SomeType@>@<():SomeType.this.TypeAlias")) + ( "member: def >#<():Int " |: node.assertValuesLink("some.pack.SomeType#>#<", "../../index.html#some.pack.SomeType@>#<():Int")) && + ( "member: def >@<():TypeAlias " |: node.assertValuesLink("some.pack.SomeType#>@<", "../../index.html#some.pack.SomeType@>@<():SomeType.this.TypeAlias")) } } |