use super::*;
use std::fs;
#[test]
fn strict_compile_validation_does_not_bail_without_a_configured_before_step() {
let tmp = tempfile::tempdir().unwrap();
let root = tmp.path();
fs::create_dir_all(root.join("src")).unwrap();
fs::create_dir_all(root.join("docs/snippets/rust")).unwrap();
fs::write(
root.join("docs/snippets/rust/example.md"),
"```rust\nfn add(left: i32, right: i32) -> i32 {\n left + right\n}\n```\n",
)
.unwrap();
let config = config_from_toml(
r#"
[workspace]
languages = ["python"]
[workspace.docs.snippets]
dirs = ["docs/snippets"]
validation_level = "compile"
strict = true
[[crates]]
name = "mylib"
sources = ["src/lib.rs"]
"#,
);
let api = make_minimal_api("1.0.0");
let (_files, result) = generate_docs_stage(&api, &config, &[Language::Python], None, root);
result.expect(
"a language with no configured `before` build step must not fail strict validation when \
its own validator compiles the snippet standalone -- the removed pre-flight gate used to \
bail here from static session config alone, without ever checking what the validator \
actually does",
);
}