INNER CODE UNIT · Rust

clear

ngless-toolkit/ngless · src/batch.rs:61

    fn clear() {
        for v in VARS {
            env::remove_var(v);
        }
    }

    #[test]
    fn ncpus_and_job_index() {
        // Save and restore so the test leaves the environment as it found it.
        let saved: Vec<(&str, Option<String>)> =
            VARS.iter().map(|v| (*v, env::var(v).ok())).collect();

        clear();
        assert_eq!(get_job_index(), None);
        assert_eq!(get_ncpus(), None);

        // LSF index, then SGE index, then LSF-wins-over-SGE precedence.
        env::set_var("SGE_TASK_ID", "3");

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…