diff --git a/lib/tests/mathslib_test.php b/lib/tests/mathslib_test.php index 1df41fe4edd..e7a7ff85858 100644 --- a/lib/tests/mathslib_test.php +++ b/lib/tests/mathslib_test.php @@ -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)); + } }