summaryrefslogtreecommitdiff
path: root/numpy/lib/tests
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2011-04-02 14:36:14 -0600
committerCharles Harris <charlesr.harris@gmail.com>2011-04-02 14:36:14 -0600
commit5e8e8eda6527e7f8765e905b221bf4477d5f446c (patch)
treedc74838a8c4703a48e45e81c6ec0306ebf0be79c /numpy/lib/tests
parent5d5266cbf90c352251ccf5d72a2a2eba7fe235b5 (diff)
downloadnumpy-5e8e8eda6527e7f8765e905b221bf4477d5f446c.tar.gz
BUG: ticket #1428, allow int64 and uint64 integer types to be specified in
genfromtxt.
Diffstat (limited to 'numpy/lib/tests')
-rw-r--r--numpy/lib/tests/test__iotools.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/numpy/lib/tests/test__iotools.py b/numpy/lib/tests/test__iotools.py
index 544057e3a..853d06087 100644
--- a/numpy/lib/tests/test__iotools.py
+++ b/numpy/lib/tests/test__iotools.py
@@ -218,6 +218,20 @@ class TestStringConverter(TestCase):
missing_values=asbytes("N/A"))
assert_equal(converter.missing_values, set(asbytes_nested(['', 'N/A'])))
+ def test_int64_dtype(self):
+ "Check that int64 integer types can be specified"
+ converter = StringConverter(np.int64, default=0)
+ val = asbytes("-9223372036854775807")
+ assert_(converter(val) == -9223372036854775807)
+ val = asbytes("9223372036854775807")
+ assert_(converter(val) == 9223372036854775807)
+
+ def test_uint64_dtype(self):
+ "Check that uint64 integer types can be specified"
+ converter = StringConverter(np.uint64, default=0)
+ val = asbytes("9223372043271415339")
+ assert_(converter(val) == 9223372043271415339)
+
#-------------------------------------------------------------------------------
class TestMiscFunctions(TestCase):
@@ -309,3 +323,5 @@ class TestMiscFunctions(TestCase):
dt_flat = flatten_dtype(dt)
assert_equal(dt_flat, [float, float])
+if __name__ == "__main__":
+ run_module_suite()