From 2a67e6f28bb9d20794a11e858a37032eacbcf00b Mon Sep 17 00:00:00 2001 From: Dan Poltawski Date: Thu, 21 Jun 2012 15:58:23 +0800 Subject: [PATCH] MDL-33911 mathslib: add unit test to demonstrate problem --- lib/tests/mathslib_test.php | 6 ++++++ 1 file changed, 6 insertions(+) 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)); + } }