aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2017-04-05 17:21:48 +0200
committerMartin Odersky <odersky@gmail.com>2017-04-05 17:21:56 +0200
commit92018967be69ffe660a225f0b58f9772388678fe (patch)
tree709d56c9be91e9e39322a964ad621f94d59904b3 /tests
parentf7027732a1d1e92f4d7525f2a984a24fdb7a0053 (diff)
downloaddotty-92018967be69ffe660a225f0b58f9772388678fe.tar.gz
dotty-92018967be69ffe660a225f0b58f9772388678fe.tar.bz2
dotty-92018967be69ffe660a225f0b58f9772388678fe.zip
Update test and add check file
Diffstat (limited to 'tests')
-rw-r--r--tests/run/planets.check8
-rw-r--r--tests/run/planets.scala2
2 files changed, 9 insertions, 1 deletions
diff --git a/tests/run/planets.check b/tests/run/planets.check
new file mode 100644
index 000000000..feb6f737d
--- /dev/null
+++ b/tests/run/planets.check
@@ -0,0 +1,8 @@
+Your weight on MERCURY is 37.775761520093525
+Your weight on SATURN is 106.60155388115666
+Your weight on VENUS is 90.49990998410455
+Your weight on URANUS is 90.51271993894251
+Your weight on EARTH is 100.0
+Your weight on NEPTUNE is 113.83280724696579
+Your weight on MARS is 37.873718403712886
+Your weight on JUPITER is 253.05575254957407
diff --git a/tests/run/planets.scala b/tests/run/planets.scala
index 2fff01edc..bcbfd7eeb 100644
--- a/tests/run/planets.scala
+++ b/tests/run/planets.scala
@@ -18,7 +18,7 @@ object Test {
import Planet._
assert(enumValueNamed("SATURN") == SATURN)
assert(enumValue(2) == EARTH)
- val earthWeight = args(0).toDouble
+ val earthWeight = 100
val mass = earthWeight/EARTH.surfaceGravity
for (p <- enumValues)
println(s"Your weight on $p is ${p.surfaceWeight(mass)}")