mirror of
https://github.com/zyycn/codex-proxy-rs.git
synced 2026-11-06 16:06:08 +00:00
10 lines
351 B
Rust
10 lines
351 B
Rust
pub(crate) fn assert_substrings_appear_in_order(haystack: &str, needles: &[&str]) {
|
|
let mut cursor = 0;
|
|
for needle in needles {
|
|
let Some(offset) = haystack[cursor..].find(needle) else {
|
|
panic!("expected substring {needle:?} after byte {cursor} in:\n{haystack}");
|
|
};
|
|
cursor += offset + needle.len();
|
|
}
|
|
}
|