Skip to content

Commit

Permalink
Ensure default impls have code coverage in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lopopolo committed May 8, 2024
1 parent 5f46e70 commit ce9bf2e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/lowercase/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@ mod tests {
let iter = Lowercase::new();
assert_eq!(iter.collect::<Vec<_>>().as_bstr(), b"".as_bstr());

let iter = Lowercase::default();
assert_eq!(iter.collect::<Vec<_>>().as_bstr(), b"".as_bstr());

let iter = Lowercase::with_slice(b"");
assert_eq!(iter.collect::<Vec<_>>().as_bstr(), b"".as_bstr());

Expand All @@ -182,6 +185,8 @@ mod tests {
#[test]
fn size_hint() {
assert_eq!(Lowercase::new().size_hint(), (0, Some(0)));
assert_eq!(Lowercase::default().size_hint(), (0, Some(0)));
assert_eq!(Lowercase::with_slice(b"").size_hint(), (0, Some(0)));

assert_eq!(Lowercase::with_slice(b"abc, xyz").size_hint(), (8, Some(8)));
assert_eq!(
Expand Down Expand Up @@ -240,6 +245,8 @@ mod tests {
#[test]
fn count() {
assert_eq!(Lowercase::new().count(), 0);
assert_eq!(Lowercase::default().count(), 0);
assert_eq!(Lowercase::with_slice(b"").count(), 0);

assert_eq!(Lowercase::with_slice(b"abc, xyz").count(), 8);
assert_eq!(Lowercase::with_slice(b"abc, \xFF\xFE, xyz").count(), 12);
Expand Down
7 changes: 7 additions & 0 deletions src/titlecase/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,9 @@ mod tests {
let iter = Titlecase::new();
assert_eq!(iter.collect::<Vec<_>>().as_bstr(), b"".as_bstr());

let iter = Titlecase::default();
assert_eq!(iter.collect::<Vec<_>>().as_bstr(), b"".as_bstr());

let iter = Titlecase::with_slice(b"");
assert_eq!(iter.collect::<Vec<_>>().as_bstr(), b"".as_bstr());

Expand All @@ -186,6 +189,8 @@ mod tests {
#[test]
fn size_hint() {
assert_eq!(Titlecase::new().size_hint(), (0, Some(0)));
assert_eq!(Titlecase::default().size_hint(), (0, Some(0)));
assert_eq!(Titlecase::with_slice(b"").size_hint(), (0, Some(0)));

assert_eq!(Titlecase::with_slice(b"abc, xyz").size_hint(), (8, Some(8)));
assert_eq!(
Expand Down Expand Up @@ -244,6 +249,8 @@ mod tests {
#[test]
fn count() {
assert_eq!(Titlecase::new().count(), 0);
assert_eq!(Titlecase::default().count(), 0);
assert_eq!(Titlecase::with_slice(b"").count(), 0);

assert_eq!(Titlecase::with_slice(b"abc, xyz").count(), 8);
assert_eq!(Titlecase::with_slice(b"abc, \xFF\xFE, xyz").count(), 12);
Expand Down
7 changes: 7 additions & 0 deletions src/uppercase/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@ mod tests {
let iter = Uppercase::new();
assert_eq!(iter.collect::<Vec<_>>().as_bstr(), b"".as_bstr());

let iter = Uppercase::default();
assert_eq!(iter.collect::<Vec<_>>().as_bstr(), b"".as_bstr());

let iter = Uppercase::with_slice(b"");
assert_eq!(iter.collect::<Vec<_>>().as_bstr(), b"".as_bstr());

Expand All @@ -182,6 +185,8 @@ mod tests {
#[test]
fn size_hint() {
assert_eq!(Uppercase::new().size_hint(), (0, Some(0)));
assert_eq!(Uppercase::default().size_hint(), (0, Some(0)));
assert_eq!(Uppercase::with_slice(b"").size_hint(), (0, Some(0)));

assert_eq!(Uppercase::with_slice(b"abc, xyz").size_hint(), (8, Some(8)));
assert_eq!(
Expand Down Expand Up @@ -240,6 +245,8 @@ mod tests {
#[test]
fn count() {
assert_eq!(Uppercase::new().count(), 0);
assert_eq!(Uppercase::default().count(), 0);
assert_eq!(Uppercase::with_slice(b"").count(), 0);

assert_eq!(Uppercase::with_slice(b"abc, xyz").count(), 8);
assert_eq!(Uppercase::with_slice(b"abc, \xFF\xFE, xyz").count(), 12);
Expand Down

0 comments on commit ce9bf2e

Please sign in to comment.