summaryrefslogtreecommitdiff
path: root/numpy/lib/tests/test_io.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/lib/tests/test_io.py')
-rw-r--r--numpy/lib/tests/test_io.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_io.py b/numpy/lib/tests/test_io.py
index a61382792..a50c6f267 100644
--- a/numpy/lib/tests/test_io.py
+++ b/numpy/lib/tests/test_io.py
@@ -403,6 +403,16 @@ class TestLoadTxt(TestCase):
dtype=ndtype)
assert_equal(test, control)
+ def test_universal_newline(self):
+ f, name = mkstemp()
+ os.write(f, asbytes('1 21\r3 42\r'))
+ os.close(f)
+
+ try:
+ data = np.loadtxt(name)
+ assert_array_equal(data, [[1, 21], [3, 42]])
+ finally:
+ os.unlink(name)
class Testfromregex(TestCase):