Merge pull request #101 from 80Quattro/master

Add tests for mean function
This commit is contained in:
Brandon Johnson 2023-01-31 00:10:52 -07:00 committed by GitHub
commit 9b9963ebf6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -119,9 +119,17 @@ class MathsTest extends TestCase
public function testMean()
{
mean(2,3,9,6);
mean(7);
mean(42,77,89,35);
assertEquals(
(2 + 4 + 6 + 8 + 20 + 50 + 70) / 7,
mean(2, 4, 6, 8, 20, 50, 70)
);
assertEquals(
(-5 - 7 + 10) / 3,
mean(-5, -7, 10)
);
assertEquals(-1, mean(-1));
}
public function testMedian()