aboutsummaryrefslogtreecommitdiff
path: root/core/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/test')
-rw-r--r--core/src/test/scala/org/apache/spark/rdd/DoubleRDDSuite.scala6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/src/test/scala/org/apache/spark/rdd/DoubleRDDSuite.scala b/core/src/test/scala/org/apache/spark/rdd/DoubleRDDSuite.scala
index 97079382c7..01039b9449 100644
--- a/core/src/test/scala/org/apache/spark/rdd/DoubleRDDSuite.scala
+++ b/core/src/test/scala/org/apache/spark/rdd/DoubleRDDSuite.scala
@@ -22,6 +22,12 @@ import org.scalatest.FunSuite
import org.apache.spark._
class DoubleRDDSuite extends FunSuite with SharedSparkContext {
+ test("sum") {
+ assert(sc.parallelize(Seq.empty[Double]).sum() === 0.0)
+ assert(sc.parallelize(Seq(1.0)).sum() === 1.0)
+ assert(sc.parallelize(Seq(1.0, 2.0)).sum() === 3.0)
+ }
+
// Verify tests on the histogram functionality. We test with both evenly
// and non-evenly spaced buckets as the bucket lookup function changes.
test("WorksOnEmpty") {