summaryrefslogtreecommitdiff
path: root/test/files/run
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2014-02-25 11:35:44 -0800
committerAdriaan Moors <adriaan.moors@typesafe.com>2014-02-25 11:35:44 -0800
commitec4479aa7d0279daa701481fb7d77c1f43617190 (patch)
treed2503ba92f1f6e22148e25b0775a6f13e2ad6a0c /test/files/run
parent5ae2fe02722d637c1d2683d18918c8a2e1ab3425 (diff)
parent1994a2d901e1ca948a53b3d00df9017782c47b5c (diff)
downloadscala-ec4479aa7d0279daa701481fb7d77c1f43617190.tar.gz
scala-ec4479aa7d0279daa701481fb7d77c1f43617190.tar.bz2
scala-ec4479aa7d0279daa701481fb7d77c1f43617190.zip
Merge pull request #3581 from Ichoran/issue/3235-minimal
SI-3235 math.round() returns wrong results for Int and Long
Diffstat (limited to 'test/files/run')
-rw-r--r--test/files/run/t3235-minimal.check12
-rw-r--r--test/files/run/t3235-minimal.flags1
-rw-r--r--test/files/run/t3235-minimal.scala8
3 files changed, 21 insertions, 0 deletions
diff --git a/test/files/run/t3235-minimal.check b/test/files/run/t3235-minimal.check
new file mode 100644
index 0000000000..d7f716002f
--- /dev/null
+++ b/test/files/run/t3235-minimal.check
@@ -0,0 +1,12 @@
+t3235-minimal.scala:3: warning: method round in class RichInt is deprecated: This is an integer type; there is no reason to round it. Perhaps you meant to call this on a floating-point value?
+ assert(123456789.round == 123456789)
+ ^
+t3235-minimal.scala:4: warning: method round in package math is deprecated: This is an integer type; there is no reason to round it. Perhaps you meant to call this with a floating-point value?
+ assert(math.round(123456789) == 123456789)
+ ^
+t3235-minimal.scala:5: warning: method round in class RichLong is deprecated: This is an integer type; there is no reason to round it. Perhaps you meant to call this on a floating-point value?
+ assert(1234567890123456789L.round == 1234567890123456789L)
+ ^
+t3235-minimal.scala:6: warning: method round in package math is deprecated: This is an integer type; there is no reason to round it. Perhaps you meant to call this with a floating-point value?
+ assert(math.round(1234567890123456789L) == 1234567890123456789L)
+ ^
diff --git a/test/files/run/t3235-minimal.flags b/test/files/run/t3235-minimal.flags
new file mode 100644
index 0000000000..dcc59ebe32
--- /dev/null
+++ b/test/files/run/t3235-minimal.flags
@@ -0,0 +1 @@
+-deprecation
diff --git a/test/files/run/t3235-minimal.scala b/test/files/run/t3235-minimal.scala
new file mode 100644
index 0000000000..dc9907b63b
--- /dev/null
+++ b/test/files/run/t3235-minimal.scala
@@ -0,0 +1,8 @@
+object Test {
+ def main(args: Array[String]) {
+ assert(123456789.round == 123456789)
+ assert(math.round(123456789) == 123456789)
+ assert(1234567890123456789L.round == 1234567890123456789L)
+ assert(math.round(1234567890123456789L) == 1234567890123456789L)
+ }
+}