MDL-33911 mathslib: add unit test to demonstrate problem
authorDan Poltawski <dan@moodle.com>
Thu, 21 Jun 2012 07:58:23 +0000 (15:58 +0800)
committerDan Poltawski <dan@moodle.com>
Thu, 21 Jun 2012 08:00:45 +0000 (16:00 +0800)
lib/tests/mathslib_test.php

index 1df41fe..e7a7ff8 100644 (file)
@@ -231,4 +231,10 @@ class mathsslib_testcase extends basic_testcase {
         $this->assertEquals($formula->evaluate(), 1e22, '', 1e22*1e-15);
 
     }
+
+    public function test_rand_float() {
+        $formula = new calc_formula('=rand_float()');
+        $result = $formula->evaluate();
+        $this->assertTrue(is_float($result));
+    }
 }