Add experimental new parser (#1554)

Move to an experimental new parser
This commit is contained in:
Jonathan Turner
2020-04-06 00:16:14 -07:00
committed by GitHub
parent 0a198b9bd0
commit c4daa2e40f
123 changed files with 2391 additions and 11585 deletions

View File

@ -338,32 +338,6 @@ fn valuesystem_change_current_path_to_parent_path() {
})
}
#[test]
fn valuesystem_change_to_home_directory() {
Playground::setup("cd_test_14", |dirs, sandbox| {
sandbox.with_files(vec![FileWithContent(
"sample.toml",
r#"
[paquete]
el = "pollo loco"
"#,
)]);
let actual = nu!(
cwd: dirs.test(),
r#"
enter sample.toml
cd paquete
cd ~
pwd | echo $it
exit
"#
);
assert_eq!(PathBuf::from(actual), PathBuf::from("/"));
})
}
#[test]
fn valuesystem_change_to_a_path_containing_spaces() {
Playground::setup("cd_test_15", |dirs, sandbox| {

View File

@ -37,5 +37,5 @@ fn sort_primitive_values() {
"#
));
assert_eq!(actual, "authors = [\"Yehuda Katz <wycats@gmail.com>\"]");
assert_eq!(actual, "authors = [\"The Nu Project Contributors\"]");
}

View File

@ -6,19 +6,23 @@ use nu_test_support::{nu, pipeline};
fn all() {
Playground::setup("sum_test_1", |dirs, sandbox| {
sandbox.with_files(vec![FileWithContentToBeTrimmed(
"meals.csv",
"meals.json",
r#"
description,calories
"1 large egg",90
"1 cup white rice",250
"1 tablespoon fish oil",108
{
meals: [
{description: "1 large egg", calories: 90},
{description: "1 cup white rice", calories: 250},
{description: "1 tablespoon fish oil", calories: 108}
]
}
"#,
)]);
let actual = nu!(
cwd: dirs.test(), pipeline(
r#"
open meals.csv
open meals.json
| get meals
| get calories
| sum
| echo $it

View File

@ -78,7 +78,7 @@ fn infers_types() {
sandbox.with_files(vec![FileWithContentToBeTrimmed(
"los_cuatro_mosqueteros.csv",
r#"
first_name,last_name,rusty_luck
first_name,last_name,rusty_luck,d
Andrés,Robalino,1,d
Jonathan,Turner,1,d
Yehuda,Katz,1,d