mirror of
https://github.com/ntex-rs/ntex.git
synced 2025-04-03 21:07:39 +03:00
21 lines
427 B
Rust
21 lines
427 B
Rust
#![deny(warnings, rust_2018_idioms)]
|
|
|
|
use ntex_bytes::Bytes;
|
|
|
|
#[test]
|
|
fn iter_len() {
|
|
let buf = Bytes::from_static(b"hello world");
|
|
let iter = buf.iter();
|
|
|
|
assert_eq!(iter.size_hint(), (11, Some(11)));
|
|
assert_eq!(iter.len(), 11);
|
|
}
|
|
|
|
#[test]
|
|
fn empty_iter_len() {
|
|
let buf = Bytes::from_static(b"");
|
|
let iter = buf.iter();
|
|
|
|
assert_eq!(iter.size_hint(), (0, Some(0)));
|
|
assert_eq!(iter.len(), 0);
|
|
}
|