diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2012-12-10 12:28:39 -0800 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2012-12-10 12:28:39 -0800 |
commit | 22e0e3b22c9667c3cee63a5cfcae14f245eac51a (patch) | |
tree | 17ebea1c860fe1d9382fcabf963bc03841314f99 /test | |
parent | 860d3002bcc3607e907e1afc39180cd2bb82e220 (diff) | |
parent | e249f2eeb8451c1b754711294ed954c8de7775fb (diff) | |
download | scala-22e0e3b22c9667c3cee63a5cfcae14f245eac51a.tar.gz scala-22e0e3b22c9667c3cee63a5cfcae14f245eac51a.tar.bz2 scala-22e0e3b22c9667c3cee63a5cfcae14f245eac51a.zip |
Merge pull request #1744 from retronym/ticket/4922
SI-4922 Show default in Scaladoc for generic methods.
Diffstat (limited to 'test')
-rw-r--r-- | test/scaladoc/run/t4922.check | 1 | ||||
-rw-r--r-- | test/scaladoc/run/t4922.scala | 32 |
2 files changed, 33 insertions, 0 deletions
diff --git a/test/scaladoc/run/t4922.check b/test/scaladoc/run/t4922.check new file mode 100644 index 0000000000..619c56180b --- /dev/null +++ b/test/scaladoc/run/t4922.check @@ -0,0 +1 @@ +Done. diff --git a/test/scaladoc/run/t4922.scala b/test/scaladoc/run/t4922.scala new file mode 100644 index 0000000000..bce87ac980 --- /dev/null +++ b/test/scaladoc/run/t4922.scala @@ -0,0 +1,32 @@ +import scala.tools.nsc.doc.model._ +import scala.tools.partest.ScaladocModelTest + +object Test extends ScaladocModelTest { + + // Test code + override def code = """ + // This the default values should be displayed + + object Test { + def f (a: Any = "".isEmpty) = () + def g[A](b: A = null) = () + } + """ + + // no need for special settings + def scaladocSettings = "" + + def testModel(rootPackage: Package) = { + // get the quick access implicit defs in scope (_package(s), _class(es), _trait(s), object(s) _method(s), _value(s)) + import access._ + + val Test = rootPackage._object("Test") + val f = Test._method("f") + val g = Test._method("g") + + def assertEqual(s1: String, s2: String) = assert(s1 == s2, s1 + " == " + s2) + + assertEqual(f.valueParams(0)(0).defaultValue.get.expression, "\"\".isEmpty") + assertEqual(g.valueParams(0)(0).defaultValue.get.expression, "null") + } +}
\ No newline at end of file |