diff options
Diffstat (limited to 'numpy/polynomial/tests/test_polynomial.py')
-rw-r--r-- | numpy/polynomial/tests/test_polynomial.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/numpy/polynomial/tests/test_polynomial.py b/numpy/polynomial/tests/test_polynomial.py index 3d9519679..583872978 100644 --- a/numpy/polynomial/tests/test_polynomial.py +++ b/numpy/polynomial/tests/test_polynomial.py @@ -383,6 +383,21 @@ class TestVander(TestCase): assert_(van.shape == (1, 5, 24)) +class TestCompanion(TestCase): + + def test_raises(self): + assert_raises(ValueError, poly.polycompanion, []) + assert_raises(ValueError, poly.polycompanion, [1]) + + def test_dimensions(self): + for i in range(1, 5): + coef = [0]*i + [1] + assert_(poly.polycompanion(coef).shape == (i, i)) + + def test_linear_root(self): + assert_(poly.polycompanion([1, 2])[0, 0] == -.5) + + class TestMisc(TestCase) : def test_polyfromroots(self) : |