Files
craft-anything/crates/analysis/tests/regression_har_date_paths.rs
BFlatandAfloat 82856a30b2 Redact HAR reports more thoroughly and count their bodies correctly (#648)
Replays #602–#605. HAR reports redact percent-encoded credential names and declared secrets in every kept field, count decoded body bytes, and template only real dates in API paths; the stand-in backend matches older recordings with the current query rules.

Co-authored-by: Afloat <132809511+Afloat16@users.noreply.github.com>
2026-11-03 20:25:48 +07:00

13 lines
534 B
Rust

use craft_anything_analysis::web_har::path_template;
#[test]
fn regression_only_calendar_dates_share_a_date_template() {
for date in ["2024-02-29", "2000-02-29", "2026-11-03", "2026-04-30"] {
assert_eq!(path_template(&format!("/reports/{date}")), "/reports/{date}");
}
for literal in ["2026-11-news", "2026-11-03-extra", "2026-02-29", "1900-02-29", "2026-13-01", "2026-00-01", "2026-04-31", "2026-01-00"] {
let path = format!("/reports/{literal}");
assert_eq!(path_template(&path), path);
}
}