From e04330de9814161f2edd08d2517b703a31b704cc Mon Sep 17 00:00:00 2001 From: Alexandre Guillemot <alexandre.guillemot@inria.fr> Date: Tue, 9 Jul 2024 16:38:16 +0200 Subject: [PATCH] track tests macro --- tests/track.rs | 45 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/tests/track.rs b/tests/track.rs index ff6bb16..2096680 100644 --- a/tests/track.rs +++ b/tests/track.rs @@ -3,7 +3,6 @@ use std::path::PathBuf; - #[test] fn track() { let path = PathBuf::from("data/2-2_1.json"); @@ -37,3 +36,47 @@ fn track() { } } } + +macro_rules! nasty_examples { + ($($name:ident: $e:expr,)*) => { + $( + #[test] + fn $name() { + println!("{}", $e); + let path = PathBuf::from($e); + let mut conf = algpath::cli::Configuration { + path: Some(path), + ..Default::default() + }; + + conf.homogenize = true; + conf.horner = true; + + let mut input_problem = algpath::cli::Problem::new_from_input(&conf).unwrap(); + let mut parametric_system = input_problem.build_parametric_system(&conf).unwrap(); + + let path = &input_problem.path; + for point in &input_problem.fiber { + let proj_point = algpath::track::ProjectivePoint { + coord: point.clone().into(), + chart: 0, + }; + let mbox = parametric_system + .find_moore_box(&path[0].clone().into(), proj_point, &mut Vec::new()) + .unwrap(); + + let _tr = parametric_system + .track(mbox, &path[1].clone().into()) + .unwrap(); + } + } + )* + }; +} + +// Nasty examples description : +// nasty_1: linear homotopy with a single degree 9 polynomial that has 4 close roots + +nasty_examples! { + nasty_1: "data/eric_1.json", +} \ No newline at end of file -- GitLab