diff options
author | Travis Oliphant <oliphant@enthought.com> | 2006-10-07 02:23:35 +0000 |
---|---|---|
committer | Travis Oliphant <oliphant@enthought.com> | 2006-10-07 02:23:35 +0000 |
commit | c75bd2d03ccc6415bb9a0f090d7e2d80b40ea2af (patch) | |
tree | c57fc526b0ce6de11ef001c7de0be794c1045a83 /numpy/lib/tests/test_shape_base.py | |
parent | 1ff0cd9948e79eecd2c8ec9ac9aa88c81c6b9dfc (diff) | |
download | numpy-c75bd2d03ccc6415bb9a0f090d7e2d80b40ea2af.tar.gz |
Add tests for tile and fix error.
Diffstat (limited to 'numpy/lib/tests/test_shape_base.py')
-rw-r--r-- | numpy/lib/tests/test_shape_base.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_shape_base.py b/numpy/lib/tests/test_shape_base.py index debd3ae8e..2704870b6 100644 --- a/numpy/lib/tests/test_shape_base.py +++ b/numpy/lib/tests/test_shape_base.py @@ -386,6 +386,17 @@ class test_kron(NumpyTestCase): assert False, "ValueError expected" +class test_tile(NumpyTestCase): + def check_basic(self): + a = array([0,1,2]) + b = [[1,2],[3,4]] + assert_equal(tile(a,2), [0,1,2,0,1,2]) + assert_equal(tile(a,(2,2)), [[0,1,2,0,1,2],[0,1,2,0,1,2]]) + assert_equal(tile(a,(1,2)), [[0,1,2,0,1,2]]) + assert_equal(tile(b, 2), [[1,2,1,2],[3,4,3,4]]) + assert_equal(tile(b,(2,1)),[[1,2],[3,4],[1,2],[3,4]]) + assert_equal(tile(b,(2,2)),[[1,2,1,2],[3,4,3,4],[1,2,1,2],[3,4,3,4]]) + # Utility def compare_results(res,desired): |