summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--numpy/core/tests/test_regression.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/numpy/core/tests/test_regression.py b/numpy/core/tests/test_regression.py
index f3866e0fe..4f9996227 100644
--- a/numpy/core/tests/test_regression.py
+++ b/numpy/core/tests/test_regression.py
@@ -1000,6 +1000,19 @@ class TestRegression(NumpyTestCase):
"('bottom', [('bleft', ('>f4', (8, 64)), (1,)), "
"('bright', '>f4', (8, 36))])]")
+ def check_nonnative_endian_fill(self, level=rlevel):
+ """ Non-native endian arrays were incorrectly filled with scalars before
+ r5034.
+ """
+ if sys.byteorder == 'little':
+ dtype = np.dtype('>i4')
+ else:
+ dtype = np.dtype('<i4')
+ x = np.empty([1], dtype=dtype)
+ x.fill(1)
+ assert_equal(x, np.array([1], dtype=dtype))
+
+
if __name__ == "__main__":
NumpyTest().run()