use blyte_cli::init::drop_overlapping;
fn s(v: &[&str]) -> Vec<String> {
v.iter().map(|x| x.to_string()).collect()
}
#[test]
fn the_broader_of_two_overlapping_pytest_steps_is_kept() {
assert_eq!(
drop_overlapping(s(&[
"pre-commit run --all-files",
"uv run pytest tests/ --no-cov -m \"not integration and not slow and not benchmark\"",
"uv run pytest tests/ -m \"not benchmark\"",
])),
s(&[
"pre-commit run --all-files",
"uv run pytest tests/ -m \"not benchmark\""
])
);
assert_eq!(
drop_overlapping(s(&["uv run pytest", "uv run pytest tests/"])),
s(&["uv run pytest"])
);
assert_eq!(
drop_overlapping(s(&[
"pytest tests/unit",
"pytest tests/integration",
"ruff check .",
"ruff check ."
])),
s(&[
"pytest tests/unit",
"pytest tests/integration",
"ruff check .",
"ruff check ."
])
);
}