From 92018967be69ffe660a225f0b58f9772388678fe Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Wed, 5 Apr 2017 17:21:48 +0200 Subject: Update test and add check file --- tests/run/planets.check | 8 ++++++++ tests/run/planets.scala | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 tests/run/planets.check (limited to 'tests') 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)}") -- cgit v1.2.3