diff options
Diffstat (limited to 'numpy/polynomial/tests/test_chebyshev.py')
-rw-r--r-- | numpy/polynomial/tests/test_chebyshev.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/numpy/polynomial/tests/test_chebyshev.py b/numpy/polynomial/tests/test_chebyshev.py index 23a17b464..367d81f58 100644 --- a/numpy/polynomial/tests/test_chebyshev.py +++ b/numpy/polynomial/tests/test_chebyshev.py @@ -440,6 +440,22 @@ class TestFitting(TestCase): x = [1, 1j, -1, -1j] assert_almost_equal(cheb.chebfit(x, x, 1), [0, 1]) + +class TestCompanion(TestCase): + + def test_raises(self): + assert_raises(ValueError, cheb.chebcompanion, []) + assert_raises(ValueError, cheb.chebcompanion, [1]) + + def test_dimensions(self): + for i in range(1, 5): + coef = [0]*i + [1] + assert_(cheb.chebcompanion(coef).shape == (i, i)) + + def test_linear_root(self): + assert_(cheb.chebcompanion([1, 2])[0, 0] == -.5) + + class TestGauss(TestCase): def test_100(self): |