sagiegurari / cargo-make
1
use super::*;
2
use envmnt;
3

4
#[test]
5
#[ignore]
6 2
fn recursion_level_changes() {
7
    // backup environment to avoid having conflicts if
8
    // the test is run within `cargo-make`.
9 2
    let rec_lvl = envmnt::get_or(RECURSION_ENV_VAR_NAME, "0");
10 2
    envmnt::remove(RECURSION_ENV_VAR_NAME);
11

12 2
    assert!(is_top());
13 2
    assert_eq!(get(), 0);
14

15 2
    increment(); // explicitly set to 0
16 2
    increment();
17 2
    assert!(!is_top());
18 2
    assert_eq!(get(), 1);
19

20 2
    increment();
21 2
    assert_eq!(get(), 2);
22

23 2
    envmnt::set(RECURSION_ENV_VAR_NAME, rec_lvl);
24 2
}

Read our documentation on viewing source code .

Loading