lib

Core libraries for Radroots
git clone https://radroots.dev/git/lib.git
Log | Files | Refs | README

legacy_quarantine.rs (1378B)


      1 use std::{fs, path::Path};
      2 
      3 const RETIRED: &[&str] = &["event_index", "event_store", "outbox", "runtime_store"];
      4 
      5 #[test]
      6 fn predecessor_storage_packages_are_removed() {
      7     let workspace = Path::new(env!("CARGO_MANIFEST_DIR"))
      8         .parent()
      9         .and_then(Path::parent)
     10         .expect("workspace root");
     11     let manifest = fs::read_to_string(workspace.join("Cargo.toml")).expect("workspace manifest");
     12 
     13     for package in RETIRED {
     14         assert!(!workspace.join("crates").join(package).exists());
     15         assert!(!manifest.contains(&format!("\"crates/{package}\"")));
     16         assert!(!manifest.contains(&format!("radroots_{package} =")));
     17     }
     18 }
     19 
     20 #[test]
     21 fn active_manifests_use_only_final_storage_packages() {
     22     let crates = Path::new(env!("CARGO_MANIFEST_DIR"))
     23         .parent()
     24         .expect("crates root");
     25     for entry in fs::read_dir(crates).expect("crates directory") {
     26         let manifest = entry.expect("crate entry").path().join("Cargo.toml");
     27         if !manifest.is_file() {
     28             continue;
     29         }
     30         let source = fs::read_to_string(&manifest).expect("crate manifest");
     31         for package in RETIRED {
     32             let retired = format!("radroots_{package}");
     33             assert!(
     34                 !source.contains(&retired),
     35                 "{} retains {retired}",
     36                 manifest.display()
     37             );
     38         }
     39     }
     40 }