app
AI Flow
Public Made by Adomby adom
Adom's AI Flow: a tool to help the AI follow all of the steps it takes to build a board.
main
John Lauer
Release 0.1.27: native rule preservation, router and evidence gates, measured external work and reviewed component over…
da373cf
use std::path::Path;
#[test]
#[ignore = "requires a native KiCad CLI, optionally ADOM_AIFLOW_KICAD_CLI"]
fn native_project_edge_rule_survives_snapshot_copy() {
let dir=std::env::temp_dir().join(format!("aiflow-native-rules-{}",std::process::id()));std::fs::create_dir_all(&dir).unwrap();
let src=Path::new(env!("CARGO_MANIFEST_DIR")).join("tests/fixtures/project-rules.kicad_pcb");
let dst=dir.join("snapshot.kicad_pcb");std::fs::copy(&src,&dst).unwrap();
aiflow_copper::copy_project_rules(src.to_str().unwrap(),dst.to_str().unwrap()).unwrap();
let with=aiflow_copper::run_drc(dst.to_str().unwrap()).unwrap();
let defaults=dir.join("default.kicad_pcb");std::fs::copy(&src,&defaults).unwrap();
let without=aiflow_copper::run_drc(defaults.to_str().unwrap()).unwrap();
let edge_count=|v:&serde_json::Value|v["violations"].as_array().unwrap().iter().filter(|v|v["type"]=="copper_edge_clearance").count();
assert_eq!(edge_count(&with),0);assert!(edge_count(&without)>0);
std::fs::remove_dir_all(dir).unwrap();
}