Skip to content

Commit fd4cd68

Browse files
committed
simplify test for escaping with <wbr> tags
1 parent ed49386 commit fd4cd68

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

src/librustdoc/html/escape/tests.rs

+2-15
Original file line numberDiff line numberDiff line change
@@ -47,21 +47,8 @@ fn escape_body_text_with_wbr_makes_sense() {
4747
use itertools::Itertools as _;
4848

4949
use super::EscapeBodyTextWithWbr as E;
50-
const C: [u8; 3] = [b'a', b'A', b'_'];
51-
for chars in [
52-
C.into_iter(),
53-
C.into_iter(),
54-
C.into_iter(),
55-
C.into_iter(),
56-
C.into_iter(),
57-
C.into_iter(),
58-
C.into_iter(),
59-
C.into_iter(),
60-
]
61-
.into_iter()
62-
.multi_cartesian_product()
63-
{
64-
let s = String::from_utf8(chars).unwrap();
50+
for chars in iter::repeat("aA_").take(8).map(str::chars).multi_cartesian_product() {
51+
let s = chars.into_iter().collect::<String>();
6552
assert_eq!(s.len(), 8);
6653
let esc = E(&s).to_string();
6754
assert!(!esc.contains("<wbr><wbr>"));

0 commit comments

Comments
 (0)