Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Restaurar algunas pruebas #51

Open
adrianbielsa1 opened this issue May 20, 2021 · 0 comments
Open

Restaurar algunas pruebas #51

adrianbielsa1 opened this issue May 20, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@adrianbielsa1
Copy link
Collaborator

adrianbielsa1 commented May 20, 2021

En uno de los pull request se eliminaron ciertos tests ya que conflictuaban con el estado actual del compilador, los cuales eran:

#[test]
fn main_test() {
    let _ = env_logger::try_init();
    fn eval_with_debugs(source: &str) -> Vec<Rc<lisp_value::LispValue>> {
        println!("SOURCE {:?}", source);
        // PARSE
        let result = eval::parse(source);
        println!("AST {:?}", result);
        assert!(result.is_ok());
        // TODO: These `env` calls can be avoided since `eval` creates its ows environment if
        // necessary.
        // Eval
        let global_env = Rc::new(env::Env::new_global());
        let result = eval::eval_program(&result.unwrap(), global_env.clone());
        println!("RESULT {:?}", result);
        println!("GLOBAL ENV {:#?}", global_env);
        result
    }
    let sources = vec![
        "(+ 1 2) (+ 3 2)",
        "(= true true)",
        "(define (myFn x) (+ x 2))",
        "(define (myFn x) (+ x 2)) (myFn 4)",
        "(define (my-fn-2? x) (+ x 2))",
        "(define myVar (+ 3 2))",
        "(if (= true true) (+ 1 2) (+ 3 4))",
    ];
    for source in &sources {
        eval_with_debugs(source);
    }
}

Estos tests se encontraban en el archivo "lib.rs". Algunos de ellos están repetidos en los tests existentes, pero otros vale la pena restaurarlos.

@adrianbielsa1 adrianbielsa1 added enhancement New feature or request good first issue Good for newcomers labels May 20, 2021
@adrianbielsa1 adrianbielsa1 self-assigned this May 20, 2021
adrianbielsa1 added a commit that referenced this issue May 20, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant