use mdtablefix::wrap::wrap_text;
use rstest::rstest;
#[rstest]
#[case(vec![
"## Verification".to_string(),
String::new(),
"```bash".to_string(),
"set -o pipefail".to_string(),
"make check-fmt 2>&1 | tee /tmp/fmt.log".to_string(),
"make lint 2>&1 | tee /tmp/lint.log".to_string(),
"make test 2>&1 | tee /tmp/test.log".to_string(),
"```".to_string(),
])]
#[case(vec![
"## Verification".to_string(),
"```bash".to_string(),
"set -o pipefail".to_string(),
"make check-fmt 2>&1 | tee /tmp/fmt.log".to_string(),
"make lint 2>&1 | tee /tmp/lint.log".to_string(),
"make test 2>&1 | tee /tmp/test.log".to_string(),
"```".to_string(),
])]
#[case(vec![
"## Verification".to_string(),
String::new(),
" set -o pipefail".to_string(),
" make check-fmt 2>&1 | tee /tmp/fmt.log".to_string(),
" make lint 2>&1 | tee /tmp/lint.log".to_string(),
" make test 2>&1 | tee /tmp/test.log".to_string(),
])]
fn wrap_text_preserves_shell_block_after_heading(#[case] input: Vec<String>) {
assert_eq!(wrap_text(&input, 80), input);
}