aboutsummaryrefslogtreecommitdiff
path: root/test/test/DottyTest.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-04-05 12:15:45 +0200
committerMartin Odersky <odersky@gmail.com>2013-04-05 12:15:45 +0200
commitf8d5c8401ab7e4a31c9f4430ad64e27d8cb08bac (patch)
tree64d0916d98f35a63da221bbdf95d44bc4467e759 /test/test/DottyTest.scala
parent2dcae86ae6937ad2f8cd8b05734eb9feb964404e (diff)
downloaddotty-f8d5c8401ab7e4a31c9f4430ad64e27d8cb08bac.tar.gz
dotty-f8d5c8401ab7e4a31c9f4430ad64e27d8cb08bac.tar.bz2
dotty-f8d5c8401ab7e4a31c9f4430ad64e27d8cb08bac.zip
Refactored test framework
Moves worksheets to test. Factored out class DottyTest and made it usable from worksheets. Added worksheet test for signatures.
Diffstat (limited to 'test/test/DottyTest.scala')
-rw-r--r--test/test/DottyTest.scala32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/test/DottyTest.scala b/test/test/DottyTest.scala
new file mode 100644
index 000000000..b5793a7eb
--- /dev/null
+++ b/test/test/DottyTest.scala
@@ -0,0 +1,32 @@
+package test
+
+import dotty.tools.dotc.core._
+import dotty.tools.dotc.core.Contexts._
+import dotty.tools.dotc.core.Symbols._
+import dotty.tools.dotc.core.Flags._
+import Types._, Symbols._, Decorators._
+import dotty.tools.dotc.util.Texts._
+import dotty.tools.dotc.core.Decorators._
+import org.junit.Test
+
+class DottyTest {
+
+ implicit val ctx: Context = {
+ val base = Context.theBase
+ import base.settings._
+ val ctx = base.initialCtx.fresh
+ .withSetting(verbose, true)
+ .withSetting(debug, true)
+ .withSetting(debugTrace, true)
+ .withSetting(Ylogcp, true)
+ .withSetting(printtypes, true)
+ .withSetting(pageWidth, 90)
+ .withSetting(log, List("<some"))
+ println(ctx.settings)
+ base.definitions.init()
+ ctx
+ }
+
+ def methType(names: String*)(paramTypes: Type*)(resultType: Type = defn.UnitType) =
+ MethodType(names.toList map (_.toTermName), paramTypes.toList, resultType)
+}