diff options
| author | Andrea Canciani <ranma42@gmail.com> | 2016-05-26 10:54:58 +0200 |
|---|---|---|
| committer | Andrea Canciani <ranma42@gmail.com> | 2016-05-26 10:54:58 +0200 |
| commit | 6b5e86b0ce543c60e201f95d57d720181281f1da (patch) | |
| tree | c7e366f63d2c720d92a9ae345cd41214715a1548 | |
| parent | 41950c64a1bcb7025b42dde05c3cec4c3993f293 (diff) | |
| download | rust-6b5e86b0ce543c60e201f95d57d720181281f1da.tar.gz rust-6b5e86b0ce543c60e201f95d57d720181281f1da.zip | |
Extend the test for `EscapeUnicode`
to also check that it is legitimately an `ExactSizeIterator`.
| -rw-r--r-- | src/libcoretest/char.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libcoretest/char.rs b/src/libcoretest/char.rs index e959e71daf7..7da876b9459 100644 --- a/src/libcoretest/char.rs +++ b/src/libcoretest/char.rs @@ -276,6 +276,12 @@ fn eu_iterator_specializations() { // Check last assert_eq!(iter.clone().last(), Some('}')); + // Check len + assert_eq!(iter.len(), len - offset); + + // Check size_hint (= len in ExactSizeIterator) + assert_eq!(iter.size_hint(), (iter.len(), Some(iter.len()))); + // Check counting assert_eq!(iter.clone().count(), len - offset); |
