// Regression test for zero-repetition capture groups,
// which caused a panic when the Vec passed into search_slots
// contained space for the capture group which would never
// have any results.
//
// See: https://github.com/rust-lang/regex/issues/1327
#[test]
fn zero_repetition_capture_group() {
use regex_automata::{
dfa::onepass::DFA, util::primitives::NonMaxUsize, Anchored, Input,
};
let expr = DFA::new(r"(abc)(ABC){0}").unwrap();
let s = "abcABC";
let input = Input::new(s).span(0..s.len()).anchored(Anchored::Yes);
// Test with 4 slots, so the whole match plus the first capture group.
let mut cache = expr.create_cache();
let mut slots: Vec