From a2dcde587eb07398d0a30189a898c614ea1ba1aa Mon Sep 17 00:00:00 2001 From: Charles Harris Date: Tue, 22 Jul 2008 06:37:48 +0000 Subject: Apply Stefan's patch for Ryan's loadtext fix. --- numpy/lib/tests/test_io.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'numpy/lib/tests/test_io.py') diff --git a/numpy/lib/tests/test_io.py b/numpy/lib/tests/test_io.py index 6ece0222f..c6a8498eb 100644 --- a/numpy/lib/tests/test_io.py +++ b/numpy/lib/tests/test_io.py @@ -232,6 +232,15 @@ class TestLoadTxt(TestCase): assert_equal(arr['stid'], ["JOE", "BOB"]) assert_equal(arr['temp'], [25.3, 27.9]) + def test_fancy_dtype(self): + c = StringIO.StringIO() + c.write('1,2,3.0\n4,5,6.0\n') + c.seek(0) + dt = np.dtype([('x', int), ('y', [('t', int), ('s', float)])]) + x = np.loadtxt(c, dtype=dt, delimiter=',') + a = np.array([(1,(2,3.0)),(4,(5,6.0))], dt) + assert_array_equal(x, a) + class Testfromregex(TestCase): def test_record(self): -- cgit v1.2.1