From b061ba3e0cd80c6ec2916a1e5771ddfe345f8011 Mon Sep 17 00:00:00 2001 From: Joey Beauvais-Feisthauer Date: Thu, 15 Aug 2024 12:56:54 -0400 Subject: [PATCH] New secondary test We shouldn't crash when extending a secondary homomorphism partially, but currently we are --- ext/tests/secondary.rs | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 ext/tests/secondary.rs diff --git a/ext/tests/secondary.rs b/ext/tests/secondary.rs new file mode 100644 index 0000000000..50d3c253b5 --- /dev/null +++ b/ext/tests/secondary.rs @@ -0,0 +1,41 @@ +use std::sync::Arc; + +use ext::{ + resolution_homomorphism::ResolutionHomomorphism, secondary::*, utils::construct_standard, +}; +use sseq::coordinates::Bidegree; + +#[test] +fn boundary_has_boundary() { + ext::utils::init_logging(); + + // Construct resolution of S_2 to stem 15 + let resolution = Arc::new(construct_standard::("S_2", None).unwrap()); + resolution.compute_through_stem(Bidegree::n_s(15, 9)); + + // Lift to secondary resolution + let res_lift = Arc::new(SecondaryResolution::new(Arc::clone(&resolution))); + res_lift.extend_all(); + + // Construct lift of "h0". This could ready be any element, but we choose "h0" for simplicity. + let hom = ResolutionHomomorphism::from_class( + "h0".to_string(), + Arc::clone(&resolution), + Arc::clone(&resolution), + Bidegree::n_s(0, 1), + &[1], + ); + + // Extend only to stem 14. The class in (14, 3) is a boundary. + hom.extend_through_stem(Bidegree::n_s(14, 9)); + + // Lift to secondary homomorphism + let hom_lift = SecondaryResolutionHomomorphism::new( + Arc::clone(&res_lift), + Arc::clone(&res_lift), + Arc::new(hom), + ); + + // Crash + hom_lift.extend_all(); +}