[commit: haddock] ghc-7.6: Tests for hiding instances (#37) (d7adab3)

David Waern <[email protected]>
Newsgroups gmane.comp.lang.haskell.cvs.ghc
Message-ID <[email protected]>
Repository : ssh://darcs.haskell.org//srv/darcs/haddock

On branch  : ghc-7.6

http://hackage.haskell.org/trac/ghc/changeset/d7adab3dbda0fc2ebabc2374adf5fab3ecd790ef

>---------------------------------------------------------------

commit d7adab3dbda0fc2ebabc2374adf5fab3ecd790ef
Author: Roman Cheplyaka <[email protected]>
Date:   Wed Jun 20 14:08:04 2012 +0300

    Tests for hiding instances (#37)

>---------------------------------------------------------------

 tests/html-tests/tests/HiddenInstances.hs          |   35 ++++++
 .../{Bug7.html.ref => HiddenInstances.html.ref}    |  110 ++++++++++----------
 2 files changed, 88 insertions(+), 57 deletions(-)

diff --git a/tests/html-tests/tests/HiddenInstances.hs b/tests/html-tests/tests/HiddenInstances.hs
new file mode 100644
index 0000000..99a6c2f
--- /dev/null
+++ b/tests/html-tests/tests/HiddenInstances.hs
@@ -0,0 +1,35 @@
+-- http://trac.haskell.org/haddock/ticket/37
+module HiddenInstances (VisibleClass, VisibleData) where
+
+-- | Should be visible
+class VisibleClass a
+
+-- | Should *not* be visible
+class HiddenClass a
+
+-- | Should *not* be visible
+data HiddenData = HiddenData
+
+-- | Should be visible
+data VisibleData = VisibleData
+
+-- | Should be visible
+instance VisibleClass Int
+
+-- | Should be visible
+instance VisibleClass VisibleData
+
+-- | Should be visible
+instance Num VisibleData
+
+-- | Should *not* be visible
+instance VisibleClass HiddenData
+
+-- | Should *not* be visible
+instance HiddenClass Int
+
+-- | Should *not* be visible
+instance HiddenClass VisibleData
+
+-- | Should *not* be visible
+instance HiddenClass HiddenData
diff --git a/tests/html-tests/tests/Bug7.html.ref b/tests/html-tests/tests/HiddenInstances.html.ref
similarity index 65%
copy from tests/html-tests/tests/Bug7.html.ref
copy to tests/html-tests/tests/HiddenInstances.html.ref
index f7ab171..c1b7592 100644
--- a/tests/html-tests/tests/Bug7.html.ref
+++ b/tests/html-tests/tests/HiddenInstances.html.ref
@@ -3,13 +3,13 @@
 ><head
   ><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"
      /><title
-    >Bug7</title
+    >HiddenInstances</title
     ><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean"
      /><script src="haddock-util.js" type="text/javascript"
     ></script
     ><script type="text/javascript"
     >//<![CDATA[
-window.onload = function () {pageLoad();setSynopsis("mini_Bug7.html");};
+window.onload = function () {pageLoad();setSynopsis("mini_HiddenInstances.html");};
 //]]>
 </script
     ></head
@@ -39,17 +39,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_Bug7.html");};
 	    ></tr
 	  ></table
 	><p class="caption"
-	>Bug7</p
-	></div
-      ><div id="description"
-      ><p class="caption"
-	>Description</p
-	><div class="doc"
-	><p
-	  >This module caused a duplicate instance in the documentation for the Foo
- type.
-</p
-	  ></div
+	>HiddenInstances</p
 	></div
       ><div id="synopsis"
       ><p id="control.syn" class="caption expander" onclick="toggleSection('syn')"
@@ -57,18 +47,16 @@ window.onload = function () {pageLoad();setSynopsis("mini_Bug7.html");};
 	><ul id="section.syn" class="hide" onclick="toggleSection('syn')"
 	><li class="src short"
 	  ><span class="keyword"
-	    >data</span
+	    >class</span
 	    >  <a href=""
-	    >Foo</a
-	    >  = <a href=""
-	    >Foo</a
-	    ></li
+	    >VisibleClass</a
+	    > a </li
 	  ><li class="src short"
 	  ><span class="keyword"
-	    >class</span
+	    >data</span
 	    >  <a href=""
-	    >Bar</a
-	    > x y </li
+	    >VisibleData</a
+	    > </li
 	  ></ul
 	></div
       ><div id="interface"
@@ -77,46 +65,43 @@ window.onload = function () {pageLoad();setSynopsis("mini_Bug7.html");};
 	><div class="top"
 	><p class="src"
 	  ><span class="keyword"
-	    >data</span
-	    >  <a name="t:Foo" class="def"
-	    >Foo</a
-	    >  </p
+	    >class</span
+	    >  <a name="t:VisibleClass" class="def"
+	    >VisibleClass</a
+	    > a </p
 	  ><div class="doc"
 	  ><p
-	    >The Foo datatype
+	    >Should be visible
 </p
 	    ></div
-	  ><div class="subs constructors"
-	  ><p class="caption"
-	    >Constructors</p
-	    ><table
-	    ><tr
-	      ><td class="src"
-		><a name="v:Foo" class="def"
-		  >Foo</a
-		  ></td
-		><td class="doc empty"
-		>&nbsp;</td
-		></tr
-	      ></table
-	    ></div
 	  ><div class="subs instances"
-	  ><p id="control.i:Foo" class="caption collapser" onclick="toggleSection('i:Foo')"
+	  ><p id="control.i:VisibleClass" class="caption collapser" onclick="toggleSection('i:VisibleClass')"
 	    >Instances</p
-	    ><div id="section.i:Foo" class="show"
+	    ><div id="section.i:VisibleClass" class="show"
 	    ><table
 	      ><tr
 		><td class="src"
 		  ><a href=""
-		    >Bar</a
+		    >VisibleClass</a
 		    > <a href=""
-		    >Foo</a
+		    >Int</a
+		    ></td
+		  ><td class="doc"
+		  ><p
+		    >Should be visible
+</p
+		    ></td
+		  ></tr
+		><tr
+		><td class="src"
+		  ><a href=""
+		    >VisibleClass</a
 		    > <a href=""
-		    >Foo</a
+		    >VisibleData</a
 		    ></td
 		  ><td class="doc"
 		  ><p
-		    >Just one instance
+		    >Should be visible
 </p
 		    ></td
 		  ></tr
@@ -127,32 +112,43 @@ window.onload = function () {pageLoad();setSynopsis("mini_Bug7.html");};
 	><div class="top"
 	><p class="src"
 	  ><span class="keyword"
-	    >class</span
-	    >  <a name="t:Bar" class="def"
-	    >Bar</a
-	    > x y </p
+	    >data</span
+	    >  <a name="t:VisibleData" class="def"
+	    >VisibleData</a
+	    >  </p
 	  ><div class="doc"
 	  ><p
-	    >The Bar class
+	    >Should be visible
 </p
 	    ></div
 	  ><div class="subs instances"
-	  ><p id="control.i:Bar" class="caption collapser" onclick="toggleSection('i:Bar')"
+	  ><p id="control.i:VisibleData" class="caption collapser" onclick="toggleSection('i:VisibleData')"
 	    >Instances</p
-	    ><div id="section.i:Bar" class="show"
+	    ><div id="section.i:VisibleData" class="show"
 	    ><table
 	      ><tr
 		><td class="src"
 		  ><a href=""
-		    >Bar</a
+		    >Num</a
 		    > <a href=""
-		    >Foo</a
+		    >VisibleData</a
+		    ></td
+		  ><td class="doc"
+		  ><p
+		    >Should be visible
+</p
+		    ></td
+		  ></tr
+		><tr
+		><td class="src"
+		  ><a href=""
+		    >VisibleClass</a
 		    > <a href=""
-		    >Foo</a
+		    >VisibleData</a
 		    ></td
 		  ><td class="doc"
 		  ><p
-		    >Just one instance
+		    >Should be visible
 </p
 		    ></td
 		  ></tr
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.