about summary refs log tree commit diff
path: root/library/core/tests/iter.rs
diff options
context:
space:
mode:
Diffstat (limited to 'library/core/tests/iter.rs')
-rw-r--r--library/core/tests/iter.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/library/core/tests/iter.rs b/library/core/tests/iter.rs
index 6b8a989fa42..ec4b49da384 100644
--- a/library/core/tests/iter.rs
+++ b/library/core/tests/iter.rs
@@ -3493,3 +3493,15 @@ fn test_flatten_non_fused_inner() {
     assert_eq!(iter.next(), Some(1));
     assert_eq!(iter.next(), None);
 }
+
+#[test]
+pub fn extend_for_unit() {
+    let mut x = 0;
+    {
+        let iter = (0..5).map(|_| {
+            x += 1;
+        });
+        ().extend(iter);
+    }
+    assert_eq!(x, 5);
+}