nushell/crates/nu-command/tests/main.rs
Jakub Žádník 26f31da711
Split merging of parser delta and stack environment (#6005)
* Remove comment

* Split delta and environment merging

* Move table mode to a more logical place

* Cleanup

* Merge environment after reading default_env.nu

* Fmt
2022-07-14 17:09:27 +03:00

26 lines
750 B
Rust

use nu_command::create_default_context;
use nu_protocol::engine::StateWorkingSet;
use quickcheck_macros::quickcheck;
mod commands;
mod format_conversions;
// use nu_engine::EvaluationContext;
#[quickcheck]
fn quickcheck_parse(data: String) -> bool {
let (tokens, err) = nu_parser::lex(data.as_bytes(), 0, b"", b"", true);
let (lite_block, err2) = nu_parser::lite_parse(&tokens);
if err.is_none() && err2.is_none() {
let context = create_default_context();
{
let mut working_set = StateWorkingSet::new(&context);
working_set.add_file("quickcheck".into(), data.as_bytes());
let _ = nu_parser::parse_block(&mut working_set, &lite_block, false, &[], false);
}
}
true
}