use crate::{execute, Session, Value};
use std::collections::HashMap;

pub fn sample1() -> String {
"
a = [-3, -4];
b = {-5: a};
c = b;
".to_string()
}

#[test]
fn parse_sample1() {
    let mut session = Session::new();
    let _ = execute(&sample1(), &mut session).unwrap();
    let a = Value::from(vec![-3, -4]);
    let mut b = HashMap::new();

    b.insert(-5, a.clone());
    let b = Value::from(b);

    assert_eq!(
        session.get_value_from_var_name("a").unwrap(),
        a
    );

    assert_eq!(
        session.get_value_from_var_name("b").unwrap(),
        b
    );

    assert_eq!(
        session.get_value_from_var_name("c").unwrap(),
        b
    );
}