Ensure _#plant resets iterator data of the cloned sequence.

This commit is contained in:
John-David Dalton
2015-08-31 18:47:37 -07:00
parent 3b131f0231
commit 2d8cc57642
2 changed files with 28 additions and 6 deletions

View File

@@ -16637,6 +16637,22 @@
skipTest(2);
}
});
test('should reset iterator data on cloned sequences', 2, function() {
if (!isNpm) {
var array1 = [2, 4],
array2 = [6, 8],
wrapped1 = _(array1).map(square);
deepEqual(_.toArray(wrapped1), [4, 16]);
var wrapped2 = wrapped1.plant(array2);
deepEqual(_.toArray(wrapped2), [36, 64]);
}
else {
skipTest(2);
}
});
}());
/*--------------------------------------------------------------------------*/