Skip to content

Commit

Permalink
Add test coverage for CowStr impl Debug
Browse files Browse the repository at this point in the history
  • Loading branch information
scouten committed Dec 9, 2023
1 parent 1cea02c commit 447fd52
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions src/tests/strings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,4 +236,43 @@ mod cow_str {
fn variant_eq<T>(a: &T, b: &T) -> bool {
std::mem::discriminant(a) == std::mem::discriminant(b)
}

#[test]
fn impl_debug() {
let c = '藏';
let s: CowStr = c.into();

assert_eq!(
format!("{s:#?}"),
r#"Inlined(
InlineStr {
inner: [
232,
151,
143,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
],
len: 3,
},
)"#
);
}
}

0 comments on commit 447fd52

Please sign in to comment.