ps-parser 1.0.1

The Powershell Parser
Documentation
#[derive(Debug)]
pub(crate) enum SessionScope {
    Current,
    New,
}

#[cfg(test)]
mod tests {
    use crate::PowerShellSession;

    #[test]
    fn test_new_scope() {
        let mut p = PowerShellSession::new();
        let input = r#"$v = 5;& { $v = 10};$v"#;
        let s = p.parse_script(input).unwrap();
        assert_eq!(s.result().to_string(), "5".to_string());
    }

    #[test]
    fn test_current_scope() {
        let mut p = PowerShellSession::new();
        let input = r#"$v = 5;. { $v = 10};$v"#;
        let s = p.parse_script(input).unwrap();
        assert_eq!(s.result().to_string(), "10".to_string());
    }
}