summaryrefslogtreecommitdiff
path: root/numpy/lib/tests/test__iotools.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/lib/tests/test__iotools.py')
-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()