summaryrefslogtreecommitdiffstats
path: root/third_party/rust/textwrap/src/fuzzing.rs
blob: b7ad4812a2f8a6f40b81476acd16940e8b122dff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//! Fuzzing helpers.

use super::Options;
use std::borrow::Cow;

/// Exposed for fuzzing so we can check the slow path is correct.
pub fn fill_slow_path<'a>(text: &str, options: Options<'_>) -> String {
    crate::fill::fill_slow_path(text, options)
}

/// Exposed for fuzzing so we can check the slow path is correct.
pub fn wrap_single_line<'a>(line: &'a str, options: &Options<'_>, lines: &mut Vec<Cow<'a, str>>) {
    crate::wrap::wrap_single_line(line, options, lines);
}

/// Exposed for fuzzing so we can check the slow path is correct.
pub fn wrap_single_line_slow_path<'a>(
    line: &'a str,
    options: &Options<'_>,
    lines: &mut Vec<Cow<'a, str>>,
) {
    crate::wrap::wrap_single_line_slow_path(line, options, lines)
}