Skip to content

Commit 3a2fc30

Browse files
committed
TST: cover assignment of empty Structure slice
1 parent 6c75041 commit 3a2fc30

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/diffpy/structure/tests/teststructure.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,10 @@ def test_xyz(self):
477477
stru[1].xyz[:] = 1
478478
self.assertTrue(numpy.array_equal([0, 0, 0], stru[0].xyz))
479479
self.assertTrue(numpy.array_equal([1, 1, 1], stru[1].xyz))
480+
# verify noop when changing empty slice
481+
xyz0 = numpy.copy(stru.xyz)
482+
stru[1:1].xyz += 1
483+
self.assertTrue(numpy.array_equal(xyz0, stru.xyz))
480484
return
481485

482486

0 commit comments

Comments
 (0)