diff options
author | michelou <michelou@epfl.ch> | 2008-02-14 19:12:33 +0000 |
---|---|---|
committer | michelou <michelou@epfl.ch> | 2008-02-14 19:12:33 +0000 |
commit | 1aad4cb6517f4c63968d11c29f8dfebd8232a49c (patch) | |
tree | d2e24081069dba144185230f85bf7ef12c433531 | |
parent | 92f5905cc65a8eb94aa05a8f95ef1f173c796612 (diff) | |
download | scala-1aad4cb6517f4c63968d11c29f8dfebd8232a49c.tar.gz scala-1aad4cb6517f4c63968d11c29f8dfebd8232a49c.tar.bz2 scala-1aad4cb6517f4c63968d11c29f8dfebd8232a49c.zip |
removed MD5 test
-rw-r--r-- | test/files/run/docgenerator.check | 182 | ||||
-rw-r--r-- | test/files/run/docgenerator.scala | 61 |
2 files changed, 191 insertions, 52 deletions
diff --git a/test/files/run/docgenerator.check b/test/files/run/docgenerator.check index eefd6a8fa6..dbb7eeed28 100644 --- a/test/files/run/docgenerator.check +++ b/test/files/run/docgenerator.check @@ -1,15 +1,177 @@ -all-classes.html: 8aafbb338f30c34743b311935135fb15 -index.html: 8e576b41d27ee91c3deb2846ec846ed +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html> + <head><title>List of all classes and objects</title> + <meta http-equiv="content-type" content="text/html; charset=UTF8"></meta><meta content="scaladoc" name="generator"></meta><link href="style.css" type="text/css" rel="stylesheet"></link><script type="text/javascript" src="script.js"></script> + </head> + <body onload="init()"><div><div class="kinds" id="Classes">Classes</div><ul class="list"> + <li id="Classes_C"><a href="examples/C0.html" target="contentFrame">C0</a></li> +<li><a href="examples/C0.C1_Protected.html" target="contentFrame">C0.C1_Protected</a></li> +<li><a href="examples/C0.C1_Public.html" target="contentFrame">C0.C1_Public</a></li> +<li><a href="examples/C0_Protected.html" target="contentFrame">C0_Protected</a></li> +<li><a href="examples/C0_Protected.C1_Protected.html" target="contentFrame">C0_Protected.C1_Protected</a></li> +<li><a href="examples/C0_Protected.C1_Public.html" target="contentFrame">C0_Protected.C1_Public</a></li> + </ul> +<div class="kinds" id="Objects">Objects</div><ul class="list"> + <li id="Objects_o"><a href="examples/obj0$object.html" target="contentFrame">obj0</a></li> +<li><a href="examples/obj0$object.obj1_Protected$object.html" target="contentFrame">obj0.obj1_Protected</a></li> +<li><a href="examples/obj0$object.obj1_Public$object.html" target="contentFrame">obj0.obj1_Public</a></li> +<li><a href="examples/obj0_Protected$object.html" target="contentFrame">obj0_Protected</a></li> +<li><a href="examples/obj0_Protected$object.obj1_Protected$object.html" target="contentFrame">obj0_Protected.obj1_Protected</a></li> +<li><a href="examples/obj0_Protected$object.obj1_Public$object.html" target="contentFrame">obj0_Protected.obj1_Public</a></li> + </ul></div></body> + </html> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html> + <head><title>Scala 2</title> + <meta http-equiv="content-type" content="text/html; charset=UTF8"></meta><meta content="scaladoc" name="generator"></meta><link href="style.css" type="text/css" rel="stylesheet"></link><script type="text/javascript" src="script.js"></script> + </head> + <frameset cols="25%, 75%"> + <frameset rows="50%, 28, 50%"> + <frame src="modules.html" name="modulesFrame"></frame> + <frame src="nav-classes.html" name="navigationFrame"></frame> + <frame src="all-classes.html" name="classesFrame"></frame> + </frameset> + <frame src="root-content.html" name="contentFrame"></frame> + </frameset> + </html> -all-classes.html: 878a8d0bd26d10e0a4efc59cb8c07d -index.html: 8e576b41d27ee91c3deb2846ec846ed +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html> + <head><title>List of all classes and objects</title> + <meta http-equiv="content-type" content="text/html; charset=UTF8"></meta><meta content="scaladoc" name="generator"></meta><link href="style.css" type="text/css" rel="stylesheet"></link><script type="text/javascript" src="script.js"></script> + </head> + <body onload="init()"><div><div class="kinds" id="Classes">Classes</div><ul class="list"> + <li id="Classes_C"><a href="examples/C0.html" target="contentFrame">C0</a></li> +<li><a href="examples/C0.C1_Public.html" target="contentFrame">C0.C1_Public</a></li> + </ul> +<div class="kinds" id="Objects">Objects</div><ul class="list"> + <li id="Objects_o"><a href="examples/obj0$object.html" target="contentFrame">obj0</a></li> +<li><a href="examples/obj0$object.obj1_Public$object.html" target="contentFrame">obj0.obj1_Public</a></li> + </ul></div></body> + </html> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html> + <head><title>Scala 2</title> + <meta http-equiv="content-type" content="text/html; charset=UTF8"></meta><meta content="scaladoc" name="generator"></meta><link href="style.css" type="text/css" rel="stylesheet"></link><script type="text/javascript" src="script.js"></script> + </head> + <frameset cols="25%, 75%"> + <frameset rows="50%, 28, 50%"> + <frame src="modules.html" name="modulesFrame"></frame> + <frame src="nav-classes.html" name="navigationFrame"></frame> + <frame src="all-classes.html" name="classesFrame"></frame> + </frameset> + <frame src="root-content.html" name="contentFrame"></frame> + </frameset> + </html> -all-classes.html: 8aafbb338f30c34743b311935135fb15 -index.html: 8e576b41d27ee91c3deb2846ec846ed +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html> + <head><title>List of all classes and objects</title> + <meta http-equiv="content-type" content="text/html; charset=UTF8"></meta><meta content="scaladoc" name="generator"></meta><link href="style.css" type="text/css" rel="stylesheet"></link><script type="text/javascript" src="script.js"></script> + </head> + <body onload="init()"><div><div class="kinds" id="Classes">Classes</div><ul class="list"> + <li id="Classes_C"><a href="examples/C0.html" target="contentFrame">C0</a></li> +<li><a href="examples/C0.C1_Protected.html" target="contentFrame">C0.C1_Protected</a></li> +<li><a href="examples/C0.C1_Public.html" target="contentFrame">C0.C1_Public</a></li> +<li><a href="examples/C0_Protected.html" target="contentFrame">C0_Protected</a></li> +<li><a href="examples/C0_Protected.C1_Protected.html" target="contentFrame">C0_Protected.C1_Protected</a></li> +<li><a href="examples/C0_Protected.C1_Public.html" target="contentFrame">C0_Protected.C1_Public</a></li> + </ul> +<div class="kinds" id="Objects">Objects</div><ul class="list"> + <li id="Objects_o"><a href="examples/obj0$object.html" target="contentFrame">obj0</a></li> +<li><a href="examples/obj0$object.obj1_Protected$object.html" target="contentFrame">obj0.obj1_Protected</a></li> +<li><a href="examples/obj0$object.obj1_Public$object.html" target="contentFrame">obj0.obj1_Public</a></li> +<li><a href="examples/obj0_Protected$object.html" target="contentFrame">obj0_Protected</a></li> +<li><a href="examples/obj0_Protected$object.obj1_Protected$object.html" target="contentFrame">obj0_Protected.obj1_Protected</a></li> +<li><a href="examples/obj0_Protected$object.obj1_Public$object.html" target="contentFrame">obj0_Protected.obj1_Public</a></li> + </ul></div></body> + </html> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html> + <head><title>Scala 2</title> + <meta http-equiv="content-type" content="text/html; charset=UTF8"></meta><meta content="scaladoc" name="generator"></meta><link href="style.css" type="text/css" rel="stylesheet"></link><script type="text/javascript" src="script.js"></script> + </head> + <frameset cols="25%, 75%"> + <frameset rows="50%, 28, 50%"> + <frame src="modules.html" name="modulesFrame"></frame> + <frame src="nav-classes.html" name="navigationFrame"></frame> + <frame src="all-classes.html" name="classesFrame"></frame> + </frameset> + <frame src="root-content.html" name="contentFrame"></frame> + </frameset> + </html> -all-classes.html: e02336df9accf2d46a6f9fc7b7daef9 -index.html: 8e576b41d27ee91c3deb2846ec846ed +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html> + <head><title>List of all classes and objects</title> + <meta http-equiv="content-type" content="text/html; charset=UTF8"></meta><meta content="scaladoc" name="generator"></meta><link href="style.css" type="text/css" rel="stylesheet"></link><script type="text/javascript" src="script.js"></script> + </head> + <body onload="init()"><div><div class="kinds" id="Classes">Classes</div><ul class="list"> + <li id="Classes_C"><a href="examples/C0.html" target="contentFrame">C0</a></li> +<li><a href="examples/C0.C1_Private.html" target="contentFrame">C0.C1_Private</a></li> +<li><a href="examples/C0.C1_Protected.html" target="contentFrame">C0.C1_Protected</a></li> +<li><a href="examples/C0.C1_Public.html" target="contentFrame">C0.C1_Public</a></li> +<li><a href="examples/C0_Protected.html" target="contentFrame">C0_Protected</a></li> +<li><a href="examples/C0_Protected.C1_Private.html" target="contentFrame">C0_Protected.C1_Private</a></li> +<li><a href="examples/C0_Protected.C1_Protected.html" target="contentFrame">C0_Protected.C1_Protected</a></li> +<li><a href="examples/C0_Protected.C1_Public.html" target="contentFrame">C0_Protected.C1_Public</a></li> + </ul> +<div class="kinds" id="Objects">Objects</div><ul class="list"> + <li id="Objects_o"><a href="examples/obj0$object.html" target="contentFrame">obj0</a></li> +<li><a href="examples/obj0$object.obj1_Private$object.html" target="contentFrame">obj0.obj1_Private</a></li> +<li><a href="examples/obj0$object.obj1_Protected$object.html" target="contentFrame">obj0.obj1_Protected</a></li> +<li><a href="examples/obj0$object.obj1_Public$object.html" target="contentFrame">obj0.obj1_Public</a></li> +<li><a href="examples/obj0_Protected$object.html" target="contentFrame">obj0_Protected</a></li> +<li><a href="examples/obj0_Protected$object.obj1_Private$object.html" target="contentFrame">obj0_Protected.obj1_Private</a></li> +<li><a href="examples/obj0_Protected$object.obj1_Protected$object.html" target="contentFrame">obj0_Protected.obj1_Protected</a></li> +<li><a href="examples/obj0_Protected$object.obj1_Public$object.html" target="contentFrame">obj0_Protected.obj1_Public</a></li> + </ul></div></body> + </html> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html> + <head><title>Scala 2</title> + <meta http-equiv="content-type" content="text/html; charset=UTF8"></meta><meta content="scaladoc" name="generator"></meta><link href="style.css" type="text/css" rel="stylesheet"></link><script type="text/javascript" src="script.js"></script> + </head> + <frameset cols="25%, 75%"> + <frameset rows="50%, 28, 50%"> + <frame src="modules.html" name="modulesFrame"></frame> + <frame src="nav-classes.html" name="navigationFrame"></frame> + <frame src="all-classes.html" name="classesFrame"></frame> + </frameset> + <frame src="root-content.html" name="contentFrame"></frame> + </frameset> + </html> -all-classes.html: 921b3ed726e4d1195d91a40c2363d69 -index.html: 8e576b41d27ee91c3deb2846ec846ed +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html> + <head><title>List of all classes and objects</title> + <meta http-equiv="content-type" content="text/html; charset=UTF8"></meta><meta content="scaladoc" name="generator"></meta><link href="style.css" type="text/css" rel="stylesheet"></link><script type="text/javascript" src="script.js"></script> + </head> + <body onload="init()"><div><div class="kinds" id="Classes">Classes</div><ul class="list"> + <li id="Classes_B"><a href="annots/Bar.html" target="contentFrame">Bar</a></li> +<li><a href="annots/Bar1.html" target="contentFrame">Bar1</a></li> +<li><a href="annots/Bar2.html" target="contentFrame">Bar2</a></li> + </ul> +<div class="kinds" id="Objects">Objects</div><ul class="list"> + <li id="Objects_B"><a href="annots/Bar1.Foo11$object.html" target="contentFrame">Bar1.Foo11</a></li> +<li id="Objects_F"><a href="annots/Foo$object.html" target="contentFrame">Foo</a></li> +<li><a href="annots/Foo1$object.html" target="contentFrame">Foo1</a></li> +<li><a href="annots/Foo1$object.Foo11$object.html" target="contentFrame">Foo1.Foo11</a></li> +<li><a href="annots/Foo2$object.html" target="contentFrame">Foo2</a></li> + </ul></div></body> + </html> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html> + <head><title>Scala 2</title> + <meta http-equiv="content-type" content="text/html; charset=UTF8"></meta><meta content="scaladoc" name="generator"></meta><link href="style.css" type="text/css" rel="stylesheet"></link><script type="text/javascript" src="script.js"></script> + </head> + <frameset cols="25%, 75%"> + <frameset rows="50%, 28, 50%"> + <frame src="modules.html" name="modulesFrame"></frame> + <frame src="nav-classes.html" name="navigationFrame"></frame> + <frame src="all-classes.html" name="classesFrame"></frame> + </frameset> + <frame src="root-content.html" name="contentFrame"></frame> + </frameset> + </html> diff --git a/test/files/run/docgenerator.scala b/test/files/run/docgenerator.scala index ea44db06fe..db214b2c4d 100644 --- a/test/files/run/docgenerator.scala +++ b/test/files/run/docgenerator.scala @@ -1,5 +1,5 @@ object Test { - import java.io.{File, FileWriter} + import java.io.{File, FileReader, FileWriter} /** Tests the generation of the HTML documentation for some Scala * code samples (see value 'code' below) with different scaladoc @@ -19,12 +19,17 @@ object Test { } private def test1(tmpDir: File) { - def testOptions(inFile: File, outDir: File, opts: String*) { + def testOptions(inFile: File, outDirName: String, opts: String*) { + val outDir = createDir(tmpDir, outDirName) val args = Array.concat(Array("-Ydoc", "-d", outDir.getPath, inFile.getPath), opts.toArray:Array[String]) if (MainDoc.main0(args)) { for (name <- List("all-classes.html", "index.html")) { - val f = new File(outDir, name) - println(name + ": " + generateMD5Sum(f)) + val outFile = new File(outDir, name) + val n = outFile.length.toInt + val in = new FileReader(outFile) + val cbuf = new Array[Char](n) + in.read(cbuf, 0, n) + println(new String(cbuf)) } println } @@ -36,10 +41,10 @@ object Test { writer.close f } - testOptions(inFile, createDir(tmpDir, "test1"), "") // none (default is -access:protected) - testOptions(inFile, createDir(tmpDir, "test2"), "-access:public") - testOptions(inFile, createDir(tmpDir, "test3"), "-access:protected") - testOptions(inFile, createDir(tmpDir, "test4"), "-access:private") + testOptions(inFile, "test1", "") // none (default is -access:protected) + testOptions(inFile, "test2", "-access:public") + testOptions(inFile, "test3", "-access:protected") + testOptions(inFile, "test4", "-access:private") } private def test2(tmpDir: File) { @@ -89,8 +94,12 @@ object Foo2 { val args = Array.concat(Array("-Ydoc", "-d", outDir.getPath, inFile.getPath)) if (MainDoc.main0(args)) { for (name <- List("all-classes.html", "index.html")) { - val f = new File(outDir, name) - println(name + ": " + generateMD5Sum(f)) + val outFile = new File(outDir, name) + val n = outFile.length.toInt + val in = new FileReader(outFile) + val cbuf = new Array[Char](n) + in.read(cbuf, 0, n) + println(new String(cbuf)) } println } @@ -144,38 +153,6 @@ object Foo2 { outDir } - private def generateMD5Sum(f: java.io.File): String = { - import java.io._, java.security._ - val digest = MessageDigest.getInstance("MD5") - val is = new FileInputStream(f) - val buffer = new Array[Byte](8192) - try { - var read = is.read(buffer) - while (read > 0) { - digest.update(buffer, 0, read) - read = is.read(buffer) - } - val hash = digest.digest() - val buf = new StringBuilder - for (i <- hash.indices) - buf.append((hash(i) & 0xFF).toHexString) - buf.toString - } - catch { - case e: IOException => - throw new RuntimeException("Unable to process file for MD5", e) - } - finally { - try { - is.close(); - } - catch { - case e: IOException => - throw new RuntimeException("Unable to close input stream for MD5 calculation", e) - } - } - } - private val code1 = """ package examples |