Fix warnings and old names (#8457)

# Description

This fixes up some clippy warnings and removes some old names/info from
our unit tests

# User-Facing Changes

Internal changes only

# Tests + Formatting

Don't forget to add tests that cover your changes.

Make sure you've run and fixed any issues with these commands:

- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A
clippy::needless_collect` to check that you're using the standard code
style
- `cargo test --workspace` to check that all tests pass

> **Note**
> from `nushell` you can also use the `toolkit` as follows
> ```bash
> use toolkit.nu # or use an `env_change` hook to activate it
automatically
> toolkit check pr
> ```

# After Submitting

If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
This commit is contained in:
JT 2023-03-15 18:54:55 +13:00 committed by GitHub
parent 57ce6a7c66
commit 61455b457d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
41 changed files with 142 additions and 158 deletions

View file

@ -395,7 +395,7 @@ mod tests {
fn parses_empty_element() -> Result<(), roxmltree::Error> { fn parses_empty_element() -> Result<(), roxmltree::Error> {
let source = "<nu></nu>"; let source = "<nu></nu>";
assert_eq!(parse(source)?, content_tag("nu", indexmap! {}, &vec![])); assert_eq!(parse(source)?, content_tag("nu", indexmap! {}, &[]));
Ok(()) Ok(())
} }
@ -409,7 +409,7 @@ mod tests {
content_tag( content_tag(
"nu", "nu",
indexmap! {}, indexmap! {},
&vec![content_string("La era de los tres caballeros")] &[content_string("La era de los tres caballeros")]
) )
); );
@ -421,7 +421,7 @@ mod tests {
let source = "\ let source = "\
<nu> <nu>
<dev>Andrés</dev> <dev>Andrés</dev>
<dev>Jonathan</dev> <dev>JT</dev>
<dev>Yehuda</dev> <dev>Yehuda</dev>
</nu>"; </nu>";
@ -431,9 +431,9 @@ mod tests {
"nu", "nu",
indexmap! {}, indexmap! {},
&vec![ &vec![
content_tag("dev", indexmap! {}, &vec![content_string("Andrés")]), content_tag("dev", indexmap! {}, &[content_string("Andrés")]),
content_tag("dev", indexmap! {}, &vec![content_string("Jonathan")]), content_tag("dev", indexmap! {}, &[content_string("JT")]),
content_tag("dev", indexmap! {}, &vec![content_string("Yehuda")]) content_tag("dev", indexmap! {}, &[content_string("Yehuda")])
] ]
) )
); );
@ -449,7 +449,7 @@ mod tests {
assert_eq!( assert_eq!(
parse(source)?, parse(source)?,
content_tag("nu", indexmap! {"version" => "2.0"}, &vec![]) content_tag("nu", indexmap! {"version" => "2.0"}, &[])
); );
Ok(()) Ok(())
@ -467,10 +467,10 @@ mod tests {
content_tag( content_tag(
"nu", "nu",
indexmap! {"version" => "2.0"}, indexmap! {"version" => "2.0"},
&vec![content_tag( &[content_tag(
"version", "version",
indexmap! {}, indexmap! {},
&vec![content_string("2.0")] &[content_string("2.0")]
)] )]
) )
); );
@ -486,7 +486,7 @@ mod tests {
assert_eq!( assert_eq!(
parse(source)?, parse(source)?,
content_tag("nu", indexmap! {"version" => "2.0", "age" => "25"}, &vec![]) content_tag("nu", indexmap! {"version" => "2.0", "age" => "25"}, &[])
); );
Ok(()) Ok(())

View file

@ -45,7 +45,7 @@ fn checks_all_columns_of_a_table_is_true() {
echo [ echo [
[ first_name, last_name, rusty_at, likes ]; [ first_name, last_name, rusty_at, likes ];
[ Andrés, Robalino, 10/11/2013, 1 ] [ Andrés, Robalino, 10/11/2013, 1 ]
[ Jonathan, Turner, 10/12/2013, 1 ] [ JT, Turner, 10/12/2013, 1 ]
[ Darren, Schroeder, 10/11/2013, 1 ] [ Darren, Schroeder, 10/11/2013, 1 ]
[ Yehuda, Katz, 10/11/2013, 1 ] [ Yehuda, Katz, 10/11/2013, 1 ]
] ]

View file

@ -21,7 +21,7 @@ fn checks_any_column_of_a_table_is_true() {
echo [ echo [
[ first_name, last_name, rusty_at, likes ]; [ first_name, last_name, rusty_at, likes ];
[ Andrés, Robalino, 10/11/2013, 1 ] [ Andrés, Robalino, 10/11/2013, 1 ]
[ Jonathan, Turner, 10/12/2013, 1 ] [ JT, Turner, 10/12/2013, 1 ]
[ Darren, Schroeder, 10/11/2013, 1 ] [ Darren, Schroeder, 10/11/2013, 1 ]
[ Yehuda, Katz, 10/11/2013, 1 ] [ Yehuda, Katz, 10/11/2013, 1 ]
] ]

View file

@ -5,7 +5,7 @@ fn adds_a_row_to_the_end() {
let actual = nu!( let actual = nu!(
cwd: ".", pipeline( cwd: ".", pipeline(
r#" r#"
echo [ "Andrés N. Robalino", "Jonathan Turner", "Yehuda Katz" ] echo [ "Andrés N. Robalino", "JT Turner", "Yehuda Katz" ]
| append "pollo loco" | append "pollo loco"
| get 3 | get 3
"# "#

View file

@ -11,7 +11,7 @@ fn discards_rows_where_given_column_is_empty() {
{ {
"amigos": [ "amigos": [
{"name": "Yehuda", "rusty_luck": 1}, {"name": "Yehuda", "rusty_luck": 1},
{"name": "Jonathan", "rusty_luck": 1}, {"name": "JT", "rusty_luck": 1},
{"name": "Andres", "rusty_luck": 1}, {"name": "Andres", "rusty_luck": 1},
{"name":"GorbyPuff"} {"name":"GorbyPuff"}
] ]

View file

@ -108,7 +108,7 @@ fn copies_the_directory_inside_directory_if_path_to_copy_is_directory_and_with_r
.within("originals") .within("originals")
.with_files(vec![ .with_files(vec![
EmptyFile("yehuda.txt"), EmptyFile("yehuda.txt"),
EmptyFile("jonathan.txt"), EmptyFile("jttxt"),
EmptyFile("andres.txt"), EmptyFile("andres.txt"),
]) ])
.mkdir("expected"); .mkdir("expected");
@ -126,7 +126,7 @@ fn copies_the_directory_inside_directory_if_path_to_copy_is_directory_and_with_r
assert!(files_exist_at( assert!(files_exist_at(
vec![ vec![
Path::new("yehuda.txt"), Path::new("yehuda.txt"),
Path::new("jonathan.txt"), Path::new("jttxt"),
Path::new("andres.txt") Path::new("andres.txt")
], ],
&expected_dir &expected_dir
@ -148,10 +148,10 @@ fn deep_copies_with_recursive_flag_impl(progress: bool) {
.within("originals/contributors") .within("originals/contributors")
.with_files(vec![ .with_files(vec![
EmptyFile("yehuda.txt"), EmptyFile("yehuda.txt"),
EmptyFile("jonathan.txt"), EmptyFile("jttxt"),
EmptyFile("andres.txt"), EmptyFile("andres.txt"),
]) ])
.within("originals/contributors/jonathan") .within("originals/contributors/JT")
.with_files(vec![EmptyFile("errors.txt"), EmptyFile("multishells.txt")]) .with_files(vec![EmptyFile("errors.txt"), EmptyFile("multishells.txt")])
.within("originals/contributors/andres") .within("originals/contributors/andres")
.with_files(vec![EmptyFile("coverage.txt"), EmptyFile("commands.txt")]) .with_files(vec![EmptyFile("coverage.txt"), EmptyFile("commands.txt")])
@ -162,7 +162,7 @@ fn deep_copies_with_recursive_flag_impl(progress: bool) {
let expected_dir = dirs.test().join("expected").join("originals"); let expected_dir = dirs.test().join("expected").join("originals");
let progress_flag = if progress { "-p" } else { "" }; let progress_flag = if progress { "-p" } else { "" };
let jonathans_expected_copied_dir = expected_dir.join("contributors").join("jonathan"); let jts_expected_copied_dir = expected_dir.join("contributors").join("JT");
let andres_expected_copied_dir = expected_dir.join("contributors").join("andres"); let andres_expected_copied_dir = expected_dir.join("contributors").join("andres");
let yehudas_expected_copied_dir = expected_dir.join("contributors").join("yehuda"); let yehudas_expected_copied_dir = expected_dir.join("contributors").join("yehuda");
@ -175,7 +175,7 @@ fn deep_copies_with_recursive_flag_impl(progress: bool) {
assert!(expected_dir.exists()); assert!(expected_dir.exists());
assert!(files_exist_at( assert!(files_exist_at(
vec![Path::new("errors.txt"), Path::new("multishells.txt")], vec![Path::new("errors.txt"), Path::new("multishells.txt")],
jonathans_expected_copied_dir jts_expected_copied_dir
)); ));
assert!(files_exist_at( assert!(files_exist_at(
vec![Path::new("coverage.txt"), Path::new("commands.txt")], vec![Path::new("coverage.txt"), Path::new("commands.txt")],
@ -216,7 +216,7 @@ fn copies_using_path_with_wildcard_impl(progress: bool) {
vec![ vec![
Path::new("caco3_plastics.csv"), Path::new("caco3_plastics.csv"),
Path::new("cargo_sample.toml"), Path::new("cargo_sample.toml"),
Path::new("jonathan.xml"), Path::new("jt.xml"),
Path::new("sample.ini"), Path::new("sample.ini"),
Path::new("sgml_description.json"), Path::new("sgml_description.json"),
Path::new("utf16.ini"), Path::new("utf16.ini"),
@ -261,7 +261,7 @@ fn copies_using_a_glob_impl(progress: bool) {
vec![ vec![
Path::new("caco3_plastics.csv"), Path::new("caco3_plastics.csv"),
Path::new("cargo_sample.toml"), Path::new("cargo_sample.toml"),
Path::new("jonathan.xml"), Path::new("jt.xml"),
Path::new("sample.ini"), Path::new("sample.ini"),
Path::new("sgml_description.json"), Path::new("sgml_description.json"),
Path::new("utf16.ini"), Path::new("utf16.ini"),
@ -317,7 +317,7 @@ fn copy_files_using_glob_two_parents_up_using_multiple_dots() {
fn copy_files_using_glob_two_parents_up_using_multiple_dots_imp(progress: bool) { fn copy_files_using_glob_two_parents_up_using_multiple_dots_imp(progress: bool) {
Playground::setup("cp_test_9", |dirs, sandbox| { Playground::setup("cp_test_9", |dirs, sandbox| {
sandbox.within("foo").within("bar").with_files(vec![ sandbox.within("foo").within("bar").with_files(vec![
EmptyFile("jonathan.json"), EmptyFile("jtjson"),
EmptyFile("andres.xml"), EmptyFile("andres.xml"),
EmptyFile("yehuda.yaml"), EmptyFile("yehuda.yaml"),
EmptyFile("kevin.txt"), EmptyFile("kevin.txt"),
@ -335,7 +335,7 @@ fn copy_files_using_glob_two_parents_up_using_multiple_dots_imp(progress: bool)
assert!(files_exist_at( assert!(files_exist_at(
vec![ vec![
"yehuda.yaml", "yehuda.yaml",
"jonathan.json", "jtjson",
"andres.xml", "andres.xml",
"kevin.txt", "kevin.txt",
"many_more.ppl", "many_more.ppl",

View file

@ -11,7 +11,7 @@ fn adds_row_data_if_column_missing() {
{ {
"amigos": [ "amigos": [
{"name": "Yehuda"}, {"name": "Yehuda"},
{"name": "Jonathan", "rusty_luck": 0}, {"name": "JT", "rusty_luck": 0},
{"name": "Andres", "rusty_luck": 0}, {"name": "Andres", "rusty_luck": 0},
{"name":"GorbyPuff"} {"name":"GorbyPuff"}
] ]

View file

@ -10,7 +10,7 @@ fn knows_the_filesystems_entered() {
.within("red_pill") .within("red_pill")
.with_files(vec![ .with_files(vec![
EmptyFile("andres.nu"), EmptyFile("andres.nu"),
EmptyFile("jonathan.nu"), EmptyFile("jtnu"),
EmptyFile("yehuda.nu"), EmptyFile("yehuda.nu"),
]) ])
.within("blue_pill") .within("blue_pill")
@ -32,7 +32,7 @@ fn knows_the_filesystems_entered() {
enter expected enter expected
mkdir recycled mkdir recycled
enter ../red_pill enter ../red_pill
mv jonathan.nu ../expected mv jtnu ../expected
enter ../blue_pill enter ../blue_pill
cp *.nxt ../expected/recycled cp *.nxt ../expected/recycled
p p
@ -54,7 +54,7 @@ fn knows_the_filesystems_entered() {
assert!(files_exist_at( assert!(files_exist_at(
vec![ vec![
Path::new("andres.nu"), Path::new("andres.nu"),
Path::new("jonathan.nu"), Path::new("jtnu"),
Path::new("yehuda.nu"), Path::new("yehuda.nu"),
], ],
expected expected

View file

@ -60,7 +60,7 @@ fn format_filesize_works() {
Playground::setup("format_filesize_test_1", |dirs, sandbox| { Playground::setup("format_filesize_test_1", |dirs, sandbox| {
sandbox.with_files(vec![ sandbox.with_files(vec![
EmptyFile("yehuda.txt"), EmptyFile("yehuda.txt"),
EmptyFile("jonathan.txt"), EmptyFile("jttxt"),
EmptyFile("andres.txt"), EmptyFile("andres.txt"),
]); ]);

View file

@ -45,7 +45,7 @@ fn fetches_by_index() {
[package] [package]
name = "nu" name = "nu"
version = "0.4.1" version = "0.4.1"
authors = ["Yehuda Katz <wycats@gmail.com>", "Jonathan Turner <jonathan.d.turner@gmail.com>", "Andrés N. Robalino <andres@androbtech.com>"] authors = ["Yehuda Katz <wycats@gmail.com>", "JT Turner <547158+jntrnr@users.noreply.github.com>", "Andrés N. Robalino <andres@androbtech.com>"]
description = "When arepas shells are tasty and fun." description = "When arepas shells are tasty and fun."
"#, "#,
)]); )]);
@ -92,7 +92,7 @@ fn column_paths_are_either_double_quoted_or_regular_unquoted_words_separated_by_
"sample.toml", "sample.toml",
r#" r#"
[package] [package]
9999 = ["Yehuda Katz <wycats@gmail.com>", "Jonathan Turner <jonathan.d.turner@gmail.com>", "Andrés N. Robalino <andres@androbtech.com>"] 9999 = ["Yehuda Katz <wycats@gmail.com>", "JT Turner <jtd.turner@gmail.com>", "Andrés N. Robalino <andres@androbtech.com>"]
description = "When arepas shells are tasty and fun." description = "When arepas shells are tasty and fun."
"#, "#,
)]); )]);

View file

@ -7,7 +7,7 @@ fn empty_glob_pattern_triggers_error() {
Playground::setup("glob_test_1", |dirs, sandbox| { Playground::setup("glob_test_1", |dirs, sandbox| {
sandbox.with_files(vec![ sandbox.with_files(vec![
EmptyFile("yehuda.txt"), EmptyFile("yehuda.txt"),
EmptyFile("jonathan.txt"), EmptyFile("jttxt"),
EmptyFile("andres.txt"), EmptyFile("andres.txt"),
]); ]);
@ -25,7 +25,7 @@ fn nonempty_glob_lists_matching_paths() {
Playground::setup("glob_sanity_star", |dirs, sandbox| { Playground::setup("glob_sanity_star", |dirs, sandbox| {
sandbox.with_files(vec![ sandbox.with_files(vec![
EmptyFile("yehuda.txt"), EmptyFile("yehuda.txt"),
EmptyFile("jonathan.txt"), EmptyFile("jttxt"),
EmptyFile("andres.txt"), EmptyFile("andres.txt"),
]); ]);
@ -43,7 +43,7 @@ fn glob_subdirs() {
Playground::setup("glob_subdirs", |dirs, sandbox| { Playground::setup("glob_subdirs", |dirs, sandbox| {
sandbox.with_files(vec![ sandbox.with_files(vec![
EmptyFile("yehuda.txt"), EmptyFile("yehuda.txt"),
EmptyFile("jonathan.txt"), EmptyFile("jttxt"),
EmptyFile("andres.txt"), EmptyFile("andres.txt"),
]); ]);
sandbox.mkdir("children"); sandbox.mkdir("children");
@ -70,7 +70,7 @@ fn glob_subdirs_ignore_dirs() {
Playground::setup("glob_subdirs_ignore_directories", |dirs, sandbox| { Playground::setup("glob_subdirs_ignore_directories", |dirs, sandbox| {
sandbox.with_files(vec![ sandbox.with_files(vec![
EmptyFile("yehuda.txt"), EmptyFile("yehuda.txt"),
EmptyFile("jonathan.txt"), EmptyFile("jttxt"),
EmptyFile("andres.txt"), EmptyFile("andres.txt"),
]); ]);
sandbox.mkdir("children"); sandbox.mkdir("children");
@ -97,7 +97,7 @@ fn glob_ignore_files() {
Playground::setup("glob_ignore_files", |dirs, sandbox| { Playground::setup("glob_ignore_files", |dirs, sandbox| {
sandbox.with_files(vec![ sandbox.with_files(vec![
EmptyFile("yehuda.txt"), EmptyFile("yehuda.txt"),
EmptyFile("jonathan.txt"), EmptyFile("jttxt"),
EmptyFile("andres.txt"), EmptyFile("andres.txt"),
]); ]);
sandbox.mkdir("children"); sandbox.mkdir("children");

View file

@ -10,7 +10,7 @@ fn groups() {
r#" r#"
first_name,last_name,rusty_at,type first_name,last_name,rusty_at,type
Andrés,Robalino,10/11/2013,A Andrés,Robalino,10/11/2013,A
Jonathan,Turner,10/12/2013,B JT,Turner,10/12/2013,B
Yehuda,Katz,10/11/2013,A Yehuda,Katz,10/11/2013,A
"#, "#,
)]); )]);
@ -39,7 +39,7 @@ fn errors_if_given_unknown_column_name() {
"nu": { "nu": {
"committers": [ "committers": [
{"name": "Andrés N. Robalino"}, {"name": "Andrés N. Robalino"},
{"name": "Jonathan Turner"}, {"name": "JT Turner"},
{"name": "Yehuda Katz"} {"name": "Yehuda Katz"}
], ],
"releases": [ "releases": [
@ -79,7 +79,7 @@ fn errors_if_block_given_evaluates_more_than_one_row() {
r#" r#"
first_name,last_name,rusty_at,type first_name,last_name,rusty_at,type
Andrés,Robalino,10/11/2013,A Andrés,Robalino,10/11/2013,A
Jonathan,Turner,10/12/2013,B JT,Turner,10/12/2013,B
Yehuda,Katz,10/11/2013,A Yehuda,Katz,10/11/2013,A
"#, "#,
)]); )]);

View file

@ -10,7 +10,7 @@ fn summarizes_by_column_given() {
r#" r#"
first_name,last_name,rusty_at first_name,last_name,rusty_at
Andrés,Robalino,Ecuador Andrés,Robalino,Ecuador
Jonathan,Turner,Estados Unidos JT,Turner,Estados Unidos
Yehuda,Katz,Estados Unidos Yehuda,Katz,Estados Unidos
"#, "#,
)]); )]);
@ -42,7 +42,7 @@ fn summarizes_by_column_given_with_normalize_percentage() {
r#" r#"
first_name,last_name,rusty_at first_name,last_name,rusty_at
Andrés,Robalino,Ecuador Andrés,Robalino,Ecuador
Jonathan,Turner,Estados Unidos JT,Turner,Estados Unidos
Yehuda,Katz,Estados Unidos Yehuda,Katz,Estados Unidos
"#, "#,
)]); )]);
@ -71,7 +71,7 @@ fn summarizes_by_values() {
r#" r#"
first_name,last_name,rusty_at first_name,last_name,rusty_at
Andrés,Robalino,Ecuador Andrés,Robalino,Ecuador
Jonathan,Turner,Estados Unidos JT,Turner,Estados Unidos
Yehuda,Katz,Estados Unidos Yehuda,Katz,Estados Unidos
"#, "#,
)]); )]);

View file

@ -7,7 +7,7 @@ fn lists_regular_files() {
Playground::setup("ls_test_1", |dirs, sandbox| { Playground::setup("ls_test_1", |dirs, sandbox| {
sandbox.with_files(vec![ sandbox.with_files(vec![
EmptyFile("yehuda.txt"), EmptyFile("yehuda.txt"),
EmptyFile("jonathan.txt"), EmptyFile("jttxt"),
EmptyFile("andres.txt"), EmptyFile("andres.txt"),
]); ]);
@ -50,7 +50,7 @@ fn lists_regular_files_using_question_mark_wildcard() {
Playground::setup("ls_test_3", |dirs, sandbox| { Playground::setup("ls_test_3", |dirs, sandbox| {
sandbox.with_files(vec![ sandbox.with_files(vec![
EmptyFile("yehuda.10.txt"), EmptyFile("yehuda.10.txt"),
EmptyFile("jonathan.10.txt"), EmptyFile("jt.10.txt"),
EmptyFile("andres.10.txt"), EmptyFile("andres.10.txt"),
EmptyFile("chicken_not_to_be_picked_up.100.txt"), EmptyFile("chicken_not_to_be_picked_up.100.txt"),
]); ]);
@ -73,10 +73,7 @@ fn lists_all_files_in_directories_from_stream() {
sandbox sandbox
.with_files(vec![EmptyFile("root1.txt"), EmptyFile("root2.txt")]) .with_files(vec![EmptyFile("root1.txt"), EmptyFile("root2.txt")])
.within("dir_a") .within("dir_a")
.with_files(vec![ .with_files(vec![EmptyFile("yehuda.10.txt"), EmptyFile("jt10.txt")])
EmptyFile("yehuda.10.txt"),
EmptyFile("jonathan.10.txt"),
])
.within("dir_b") .within("dir_b")
.with_files(vec![ .with_files(vec![
EmptyFile("andres.10.txt"), EmptyFile("andres.10.txt"),
@ -132,7 +129,7 @@ fn list_files_from_two_parents_up_using_multiple_dots() {
Playground::setup("ls_test_6", |dirs, sandbox| { Playground::setup("ls_test_6", |dirs, sandbox| {
sandbox.with_files(vec![ sandbox.with_files(vec![
EmptyFile("yahuda.yaml"), EmptyFile("yahuda.yaml"),
EmptyFile("jonathan.json"), EmptyFile("jtjson"),
EmptyFile("andres.xml"), EmptyFile("andres.xml"),
EmptyFile("kevin.txt"), EmptyFile("kevin.txt"),
]); ]);
@ -185,7 +182,7 @@ fn lists_all_hidden_files_when_glob_contains_dot() {
.within("dir_a") .within("dir_a")
.with_files(vec![ .with_files(vec![
EmptyFile("yehuda.10.txt"), EmptyFile("yehuda.10.txt"),
EmptyFile("jonathan.10.txt"), EmptyFile("jt10.txt"),
EmptyFile(".dotfile2"), EmptyFile(".dotfile2"),
]) ])
.within("dir_b") .within("dir_b")
@ -222,7 +219,7 @@ fn lists_all_hidden_files_when_glob_does_not_contain_dot() {
.within("dir_a") .within("dir_a")
.with_files(vec![ .with_files(vec![
EmptyFile("yehuda.10.txt"), EmptyFile("yehuda.10.txt"),
EmptyFile("jonathan.10.txt"), EmptyFile("jt10.txt"),
EmptyFile(".dotfile2"), EmptyFile(".dotfile2"),
]) ])
.within(".dir_b") .within(".dir_b")
@ -284,10 +281,9 @@ fn glob_with_hidden_directory() {
#[cfg(unix)] #[cfg(unix)]
fn fails_with_ls_to_dir_without_permission() { fn fails_with_ls_to_dir_without_permission() {
Playground::setup("ls_test_1", |dirs, sandbox| { Playground::setup("ls_test_1", |dirs, sandbox| {
sandbox.within("dir_a").with_files(vec![ sandbox
EmptyFile("yehuda.11.txt"), .within("dir_a")
EmptyFile("jonathan.10.txt"), .with_files(vec![EmptyFile("yehuda.11.txt"), EmptyFile("jt10.txt")]);
]);
let actual = nu!( let actual = nu!(
cwd: dirs.test(), pipeline( cwd: dirs.test(), pipeline(
@ -317,7 +313,7 @@ fn lists_files_including_starting_with_dot() {
Playground::setup("ls_test_9", |dirs, sandbox| { Playground::setup("ls_test_9", |dirs, sandbox| {
sandbox.with_files(vec![ sandbox.with_files(vec![
EmptyFile("yehuda.txt"), EmptyFile("yehuda.txt"),
EmptyFile("jonathan.txt"), EmptyFile("jttxt"),
EmptyFile("andres.txt"), EmptyFile("andres.txt"),
EmptyFile(".hidden1.txt"), EmptyFile(".hidden1.txt"),
EmptyFile(".hidden2.txt"), EmptyFile(".hidden2.txt"),

View file

@ -11,7 +11,7 @@ fn row() {
r#" r#"
name,country,luck name,country,luck
Andrés,Ecuador,0 Andrés,Ecuador,0
Jonathan,USA,0 JT,USA,0
Jason,Canada,0 Jason,Canada,0
Yehuda,USA,0 Yehuda,USA,0
"#, "#,
@ -21,7 +21,7 @@ fn row() {
r#" r#"
name,country,luck name,country,luck
Andrés Robalino,Guayaquil Ecuador,1 Andrés Robalino,Guayaquil Ecuador,1
Jonathan Turner,New Zealand,1 JT Turner,New Zealand,1
"#, "#,
), ),
]); ]);

View file

@ -45,10 +45,7 @@ fn moves_columns_before() {
-------,-------, D ,---,--------, R ,--------- -------,-------, D ,---,--------, R ,---------
-------,-------, E ,---,--------, S ,--------- -------,-------, E ,---,--------, S ,---------
-------,-------, : ,---,--------, : ,--------- -------,-------, : ,---,--------, : ,---------
-------,-------, J ,---,--------, O ,--------- -------,-------, J ,---,--------, T ,---------
-------,-------, N ,---,--------, A ,---------
-------,-------, T ,---,--------, H ,---------
-------,-------, A ,---,--------, N ,---------
"#, "#,
)]); )]);
@ -65,7 +62,7 @@ fn moves_columns_before() {
"# "#
)); ));
assert!(actual.out.contains("ANDRES::JONATHAN")); assert!(actual.out.contains("ANDRES::JT"));
}) })
} }
@ -80,10 +77,7 @@ fn moves_a_column_after() {
-------,-------, D ,---,--------, R ,--------- -------,-------, D ,---,--------, R ,---------
-------,-------, E ,---,--------, S ,--------- -------,-------, E ,---,--------, S ,---------
-------,-------, : ,---,--------, : ,--------- -------,-------, : ,---,--------, : ,---------
-------,-------, J ,---,--------, O ,--------- -------,-------, J ,---,--------, T ,---------
-------,-------, N ,---,--------, A ,---------
-------,-------, T ,---,--------, H ,---------
-------,-------, A ,---,--------, N ,---------
"#, "#,
)]); )]);
@ -101,7 +95,7 @@ fn moves_a_column_after() {
"# "#
)); ));
assert!(actual.out.contains("ANDRES::JONATHAN")); assert!(actual.out.contains("ANDRES::JT"));
}) })
} }
@ -116,10 +110,7 @@ fn moves_columns_after() {
-------,-------, D ,---,--------, R ,--------- -------,-------, D ,---,--------, R ,---------
-------,-------, E ,---,--------, S ,--------- -------,-------, E ,---,--------, S ,---------
-------,-------, : ,---,--------, : ,--------- -------,-------, : ,---,--------, : ,---------
-------,-------, J ,---,--------, O ,--------- -------,-------, J ,---,--------, T ,---------
-------,-------, N ,---,--------, A ,---------
-------,-------, T ,---,--------, H ,---------
-------,-------, A ,---,--------, N ,---------
"#, "#,
)]); )]);

View file

@ -25,14 +25,14 @@ fn moves_a_file() {
#[test] #[test]
fn overwrites_if_moving_to_existing_file_and_force_provided() { fn overwrites_if_moving_to_existing_file_and_force_provided() {
Playground::setup("mv_test_2", |dirs, sandbox| { Playground::setup("mv_test_2", |dirs, sandbox| {
sandbox.with_files(vec![EmptyFile("andres.txt"), EmptyFile("jonathan.txt")]); sandbox.with_files(vec![EmptyFile("andres.txt"), EmptyFile("jttxt")]);
let original = dirs.test().join("andres.txt"); let original = dirs.test().join("andres.txt");
let expected = dirs.test().join("jonathan.txt"); let expected = dirs.test().join("jttxt");
nu!( nu!(
cwd: dirs.test(), cwd: dirs.test(),
"mv andres.txt -f jonathan.txt" "mv andres.txt -f jttxt"
); );
assert!(!original.exists()); assert!(!original.exists());
@ -62,15 +62,15 @@ fn moves_a_directory() {
fn moves_the_file_inside_directory_if_path_to_move_is_existing_directory() { fn moves_the_file_inside_directory_if_path_to_move_is_existing_directory() {
Playground::setup("mv_test_4", |dirs, sandbox| { Playground::setup("mv_test_4", |dirs, sandbox| {
sandbox sandbox
.with_files(vec![EmptyFile("jonathan.txt")]) .with_files(vec![EmptyFile("jttxt")])
.mkdir("expected"); .mkdir("expected");
let original_dir = dirs.test().join("jonathan.txt"); let original_dir = dirs.test().join("jttxt");
let expected = dirs.test().join("expected/jonathan.txt"); let expected = dirs.test().join("expected/jttxt");
nu!( nu!(
cwd: dirs.test(), cwd: dirs.test(),
"mv jonathan.txt expected" "mv jttxt expected"
); );
assert!(!original_dir.exists()); assert!(!original_dir.exists());
@ -83,7 +83,7 @@ fn moves_the_directory_inside_directory_if_path_to_move_is_existing_directory()
Playground::setup("mv_test_5", |dirs, sandbox| { Playground::setup("mv_test_5", |dirs, sandbox| {
sandbox sandbox
.within("contributors") .within("contributors")
.with_files(vec![EmptyFile("jonathan.txt")]) .with_files(vec![EmptyFile("jttxt")])
.mkdir("expected"); .mkdir("expected");
let original_dir = dirs.test().join("contributors"); let original_dir = dirs.test().join("contributors");
@ -96,7 +96,7 @@ fn moves_the_directory_inside_directory_if_path_to_move_is_existing_directory()
assert!(!original_dir.exists()); assert!(!original_dir.exists());
assert!(expected.exists()); assert!(expected.exists());
assert!(files_exist_at(vec!["jonathan.txt"], expected)) assert!(files_exist_at(vec!["jttxt"], expected))
}) })
} }
@ -109,8 +109,8 @@ fn moves_using_path_with_wildcard() {
EmptyFile("andres.ini"), EmptyFile("andres.ini"),
EmptyFile("caco3_plastics.csv"), EmptyFile("caco3_plastics.csv"),
EmptyFile("cargo_sample.toml"), EmptyFile("cargo_sample.toml"),
EmptyFile("jonathan.ini"), EmptyFile("jt.ini"),
EmptyFile("jonathan.xml"), EmptyFile("jt.xml"),
EmptyFile("sgml_description.json"), EmptyFile("sgml_description.json"),
EmptyFile("sample.ini"), EmptyFile("sample.ini"),
EmptyFile("utf16.ini"), EmptyFile("utf16.ini"),
@ -125,7 +125,7 @@ fn moves_using_path_with_wildcard() {
nu!(cwd: work_dir, "mv ../originals/*.ini ../expected"); nu!(cwd: work_dir, "mv ../originals/*.ini ../expected");
assert!(files_exist_at( assert!(files_exist_at(
vec!["yehuda.ini", "jonathan.ini", "sample.ini", "andres.ini",], vec!["yehuda.ini", "jt.ini", "sample.ini", "andres.ini",],
expected expected
)); ));
}) })
@ -210,11 +210,11 @@ fn errors_if_source_doesnt_exist() {
#[test] #[test]
fn error_if_moving_to_existing_file_without_force() { fn error_if_moving_to_existing_file_without_force() {
Playground::setup("mv_test_10_0", |dirs, sandbox| { Playground::setup("mv_test_10_0", |dirs, sandbox| {
sandbox.with_files(vec![EmptyFile("andres.txt"), EmptyFile("jonathan.txt")]); sandbox.with_files(vec![EmptyFile("andres.txt"), EmptyFile("jttxt")]);
let actual = nu!( let actual = nu!(
cwd: dirs.test(), cwd: dirs.test(),
"mv andres.txt jonathan.txt" "mv andres.txt jttxt"
); );
assert!(actual.err.contains("file already exists")) assert!(actual.err.contains("file already exists"))
}) })
@ -309,7 +309,7 @@ fn does_not_error_on_relative_parent_path() {
fn move_files_using_glob_two_parents_up_using_multiple_dots() { fn move_files_using_glob_two_parents_up_using_multiple_dots() {
Playground::setup("mv_test_12", |dirs, sandbox| { Playground::setup("mv_test_12", |dirs, sandbox| {
sandbox.within("foo").within("bar").with_files(vec![ sandbox.within("foo").within("bar").with_files(vec![
EmptyFile("jonathan.json"), EmptyFile("jtjson"),
EmptyFile("andres.xml"), EmptyFile("andres.xml"),
EmptyFile("yehuda.yaml"), EmptyFile("yehuda.yaml"),
EmptyFile("kevin.txt"), EmptyFile("kevin.txt"),
@ -325,7 +325,7 @@ fn move_files_using_glob_two_parents_up_using_multiple_dots() {
let files = vec![ let files = vec![
"yehuda.yaml", "yehuda.yaml",
"jonathan.json", "jtjson",
"andres.xml", "andres.xml",
"kevin.txt", "kevin.txt",
"many_more.ppl", "many_more.ppl",

View file

@ -10,7 +10,7 @@ fn parses_csv() {
"nu.zion.csv", "nu.zion.csv",
r#" r#"
author,lang,source author,lang,source
Jonathan Turner,Rust,New Zealand JT Turner,Rust,New Zealand
Andres N. Robalino,Rust,Ecuador Andres N. Robalino,Rust,Ecuador
Yehuda Katz,Rust,Estados Unidos Yehuda Katz,Rust,Estados Unidos
"#, "#,
@ -180,7 +180,7 @@ fn parses_xml() {
let actual = nu!( let actual = nu!(
cwd: "tests/fixtures/formats", cwd: "tests/fixtures/formats",
pipeline(r#" pipeline(r#"
open jonathan.xml open jt.xml
| get content | get content
| where tag == channel | where tag == channel
| get content | get content
@ -193,10 +193,7 @@ fn parses_xml() {
"#) "#)
); );
assert_eq!( assert_eq!(actual.out, "https://www.jntrnr.com/off-to-new-adventures/")
actual.out,
"http://www.jonathanturner.org/2015/10/off-to-new-adventures.html"
)
} }
#[cfg(feature = "dataframe")] #[cfg(feature = "dataframe")]
@ -242,7 +239,7 @@ fn open_dir_is_ls() {
Playground::setup("open_dir", |dirs, sandbox| { Playground::setup("open_dir", |dirs, sandbox| {
sandbox.with_files(vec![ sandbox.with_files(vec![
EmptyFile("yehuda.txt"), EmptyFile("yehuda.txt"),
EmptyFile("jonathan.txt"), EmptyFile("jttxt"),
EmptyFile("andres.txt"), EmptyFile("andres.txt"),
]); ]);

View file

@ -12,7 +12,7 @@ mod simple {
"key_value_separated_arepa_ingredients.txt", "key_value_separated_arepa_ingredients.txt",
r#" r#"
VAR1=Cheese VAR1=Cheese
VAR2=JonathanParsed VAR2=JTParsed
VAR3=NushellSecretIngredient VAR3=NushellSecretIngredient
"#, "#,
)]); )]);
@ -29,7 +29,7 @@ mod simple {
"# "#
)); ));
assert_eq!(actual.out, "JonathanParsed"); assert_eq!(actual.out, "JTParsed");
}) })
} }

View file

@ -9,7 +9,7 @@ fn adds_a_row_to_the_beginning() {
"los_tres_caballeros.txt", "los_tres_caballeros.txt",
r#" r#"
Andrés N. Robalino Andrés N. Robalino
Jonathan Turner JT Turner
Yehuda Katz Yehuda Katz
"#, "#,
)]); )]);

View file

@ -8,7 +8,7 @@ fn regular_columns() {
[first_name, last_name, rusty_at, type]; [first_name, last_name, rusty_at, type];
[Andrés Robalino 10/11/2013 A] [Andrés Robalino 10/11/2013 A]
[Jonathan Turner 10/12/2013 B] [JT Turner 10/12/2013 B]
[Yehuda Katz 10/11/2013 A] [Yehuda Katz 10/11/2013 A]
] ]
| reject type first_name | reject type first_name
@ -36,7 +36,7 @@ fn complex_nested_columns() {
"nu": { "nu": {
"committers": [ "committers": [
{"name": "Andrés N. Robalino"}, {"name": "Andrés N. Robalino"},
{"name": "Jonathan Turner"}, {"name": "JT Turner"},
{"name": "Yehuda Katz"} {"name": "Yehuda Katz"}
], ],
"releases": [ "releases": [

View file

@ -9,7 +9,7 @@ fn changes_the_column_name() {
"los_cuatro_mosqueteros.txt", "los_cuatro_mosqueteros.txt",
r#" r#"
Andrés N. Robalino Andrés N. Robalino
Jonathan Turner JT Turner
Yehuda Katz Yehuda Katz
Jason Gedge Jason Gedge
"#, "#,
@ -38,7 +38,7 @@ fn keeps_remaining_original_names_given_less_new_names_than_total_original_names
"los_cuatro_mosqueteros.txt", "los_cuatro_mosqueteros.txt",
r#" r#"
Andrés N. Robalino Andrés N. Robalino
Jonathan Turner JT Turner
Yehuda Katz Yehuda Katz
Jason Gedge Jason Gedge
"#, "#,
@ -68,7 +68,7 @@ fn errors_if_no_columns_present() {
"los_cuatro_mosqueteros.txt", "los_cuatro_mosqueteros.txt",
r#" r#"
Andrés N. Robalino Andrés N. Robalino
Jonathan Turner JT Turner
Yehuda Katz Yehuda Katz
Jason Gedge Jason Gedge
"#, "#,
@ -94,7 +94,7 @@ fn errors_if_columns_param_is_empty() {
"los_cuatro_mosqueteros.txt", "los_cuatro_mosqueteros.txt",
r#" r#"
Andrés N. Robalino Andrés N. Robalino
Jonathan Turner JT Turner
Yehuda Katz Yehuda Katz
Jason Gedge Jason Gedge
"#, "#,

View file

@ -108,7 +108,7 @@ fn removes_directory_contents_with_recursive_flag() {
Playground::setup("rm_test_5", |dirs, sandbox| { Playground::setup("rm_test_5", |dirs, sandbox| {
sandbox.with_files(vec![ sandbox.with_files(vec![
EmptyFile("yehuda.txt"), EmptyFile("yehuda.txt"),
EmptyFile("jonathan.txt"), EmptyFile("jttxt"),
EmptyFile("andres.txt"), EmptyFile("andres.txt"),
]); ]);
@ -187,13 +187,13 @@ fn removes_multiple_files() {
Playground::setup("rm_test_10", |dirs, sandbox| { Playground::setup("rm_test_10", |dirs, sandbox| {
sandbox.with_files(vec![ sandbox.with_files(vec![
EmptyFile("yehuda.txt"), EmptyFile("yehuda.txt"),
EmptyFile("jonathan.txt"), EmptyFile("jttxt"),
EmptyFile("andres.txt"), EmptyFile("andres.txt"),
]); ]);
nu!( nu!(
cwd: dirs.test(), cwd: dirs.test(),
"rm yehuda.txt jonathan.txt andres.txt" "rm yehuda.txt jttxt andres.txt"
); );
assert_eq!( assert_eq!(
@ -208,7 +208,7 @@ fn removes_multiple_files_with_asterisks() {
Playground::setup("rm_test_11", |dirs, sandbox| { Playground::setup("rm_test_11", |dirs, sandbox| {
sandbox.with_files(vec![ sandbox.with_files(vec![
EmptyFile("yehuda.txt"), EmptyFile("yehuda.txt"),
EmptyFile("jonathan.txt"), EmptyFile("jt.txt"),
EmptyFile("andres.toml"), EmptyFile("andres.toml"),
]); ]);
@ -227,7 +227,7 @@ fn removes_multiple_files_with_asterisks() {
#[test] #[test]
fn allows_doubly_specified_file() { fn allows_doubly_specified_file() {
Playground::setup("rm_test_12", |dirs, sandbox| { Playground::setup("rm_test_12", |dirs, sandbox| {
sandbox.with_files(vec![EmptyFile("yehuda.txt"), EmptyFile("jonathan.toml")]); sandbox.with_files(vec![EmptyFile("yehuda.txt"), EmptyFile("jt.toml")]);
let actual = nu!( let actual = nu!(
cwd: dirs.test(), cwd: dirs.test(),
@ -247,7 +247,7 @@ fn remove_files_from_two_parents_up_using_multiple_dots_and_glob() {
Playground::setup("rm_test_13", |dirs, sandbox| { Playground::setup("rm_test_13", |dirs, sandbox| {
sandbox.with_files(vec![ sandbox.with_files(vec![
EmptyFile("yehuda.txt"), EmptyFile("yehuda.txt"),
EmptyFile("jonathan.txt"), EmptyFile("jt.txt"),
EmptyFile("kevin.txt"), EmptyFile("kevin.txt"),
]); ]);
@ -259,7 +259,7 @@ fn remove_files_from_two_parents_up_using_multiple_dots_and_glob() {
); );
assert!(!files_exist_at( assert!(!files_exist_at(
vec!["yehuda.txt", "jonathan.txt", "kevin.txt"], vec!["yehuda.txt", "jttxt", "kevin.txt"],
dirs.test() dirs.test()
)); ));
}) })

View file

@ -55,7 +55,7 @@ mod columns {
[ "Andres", EC, amarillito] [ "Andres", EC, amarillito]
[ "Darren", US, black] [ "Darren", US, black]
[ "Jonathan", US, black] [ "JT", US, black]
[ "Yehuda", US, black] [ "Yehuda", US, black]
[ "Jason", CA, gold] [ "Jason", CA, gold]
]"#, ]"#,

View file

@ -10,7 +10,7 @@ fn regular_columns() {
[first_name, last_name, rusty_at, type]; [first_name, last_name, rusty_at, type];
[Andrés Robalino 10/11/2013 A] [Andrés Robalino 10/11/2013 A]
[Jonathan Turner 10/12/2013 B] [JT Turner 10/12/2013 B]
[Yehuda Katz 10/11/2013 A] [Yehuda Katz 10/11/2013 A]
] ]
| select rusty_at last_name | select rusty_at last_name
@ -32,7 +32,7 @@ fn complex_nested_columns() {
"nu": { "nu": {
"committers": [ "committers": [
{"name": "Andrés N. Robalino"}, {"name": "Andrés N. Robalino"},
{"name": "Jonathan Turner"}, {"name": "JT Turner"},
{"name": "Yehuda Katz"} {"name": "Yehuda Katz"}
], ],
"releases": [ "releases": [
@ -73,7 +73,7 @@ fn fails_if_given_unknown_column_name() {
[first_name, last_name, rusty_at, type]; [first_name, last_name, rusty_at, type];
[Andrés Robalino 10/11/2013 A] [Andrés Robalino 10/11/2013 A]
[Jonathan Turner 10/12/2013 B] [JT Turner 10/12/2013 B]
[Yehuda Katz 10/11/2013 A] [Yehuda Katz 10/11/2013 A]
] ]
| select rrusty_at first_name | select rrusty_at first_name

View file

@ -13,17 +13,17 @@ fn condition_is_met() {
Chicken Collection,29/04/2020,30/04/2020,31/04/2020 Chicken Collection,29/04/2020,30/04/2020,31/04/2020
Yellow Chickens,,, Yellow Chickens,,,
Andrés,0,0,1 Andrés,0,0,1
Jonathan,0,0,1 JT,0,0,1
Jason,0,0,1 Jason,0,0,1
Yehuda,0,0,1 Yehuda,0,0,1
Blue Chickens,,, Blue Chickens,,,
Andrés,0,0,1 Andrés,0,0,1
Jonathan,0,0,1 JT,0,0,1
Jason,0,0,1 Jason,0,0,1
Yehuda,0,0,2 Yehuda,0,0,2
Red Chickens,,, Red Chickens,,,
Andrés,0,0,1 Andrés,0,0,1
Jonathan,0,0,1 JT,0,0,1
Jason,0,0,1 Jason,0,0,1
Yehuda,0,0,3 Yehuda,0,0,3
"#, "#,

View file

@ -13,17 +13,17 @@ fn condition_is_met() {
Chicken Collection,29/04/2020,30/04/2020,31/04/2020 Chicken Collection,29/04/2020,30/04/2020,31/04/2020
Yellow Chickens,,, Yellow Chickens,,,
Andrés,0,0,1 Andrés,0,0,1
Jonathan,0,0,1 JT,0,0,1
Jason,0,0,1 Jason,0,0,1
Yehuda,0,0,1 Yehuda,0,0,1
Blue Chickens,,, Blue Chickens,,,
Andrés,0,0,1 Andrés,0,0,1
Jonathan,0,0,1 JT,0,0,1
Jason,0,0,1 Jason,0,0,1
Yehuda,0,0,2 Yehuda,0,0,2
Red Chickens,,, Red Chickens,,,
Andrés,0,0,1 Andrés,0,0,1
Jonathan,0,0,1 JT,0,0,1
Jason,0,0,1 Jason,0,0,1
Yehuda,0,0,3 Yehuda,0,0,3
"#, "#,

View file

@ -10,7 +10,7 @@ fn splits() {
r#" r#"
first_name,last_name,rusty_at,type first_name,last_name,rusty_at,type
Andrés,Robalino,10/11/2013,A Andrés,Robalino,10/11/2013,A
Jonathan,Turner,10/12/2013,B JT,Turner,10/12/2013,B
Yehuda,Katz,10/11/2013,A Yehuda,Katz,10/11/2013,A
"#, "#,
)]); )]);

View file

@ -10,7 +10,7 @@ fn rows() {
r#" r#"
name,lucky_code name,lucky_code
Andrés,1 Andrés,1
Jonathan,1 JT,1
Jason,2 Jason,2
Yehuda,1 Yehuda,1
"#, "#,

View file

@ -13,17 +13,17 @@ fn condition_is_met() {
Chicken Collection,29/04/2020,30/04/2020,31/04/2020 Chicken Collection,29/04/2020,30/04/2020,31/04/2020
Yellow Chickens,,, Yellow Chickens,,,
Andrés,1,1,1 Andrés,1,1,1
Jonathan,1,1,1 JT,1,1,1
Jason,1,1,1 Jason,1,1,1
Yehuda,1,1,1 Yehuda,1,1,1
Blue Chickens,,, Blue Chickens,,,
Andrés,1,1,2 Andrés,1,1,2
Jonathan,1,1,2 JT,1,1,2
Jason,1,1,2 Jason,1,1,2
Yehuda,1,1,2 Yehuda,1,1,2
Red Chickens,,, Red Chickens,,,
Andrés,1,1,3 Andrés,1,1,3
Jonathan,1,1,3 JT,1,1,3
Jason,1,1,3 Jason,1,1,3
Yehuda,1,1,3 Yehuda,1,1,3
"#, "#,

View file

@ -13,17 +13,17 @@ fn condition_is_met() {
Chicken Collection,29/04/2020,30/04/2020,31/04/2020 Chicken Collection,29/04/2020,30/04/2020,31/04/2020
Yellow Chickens,,, Yellow Chickens,,,
Andrés,1,1,1 Andrés,1,1,1
Jonathan,1,1,1 JT,1,1,1
Jason,1,1,1 Jason,1,1,1
Yehuda,1,1,1 Yehuda,1,1,1
Blue Chickens,,, Blue Chickens,,,
Andrés,1,1,2 Andrés,1,1,2
Jonathan,1,1,2 JT,1,1,2
Jason,1,1,2 Jason,1,1,2
Yehuda,1,1,2 Yehuda,1,1,2
Red Chickens,,, Red Chickens,,,
Andrés,1,1,3 Andrés,1,1,3
Jonathan,1,1,3 JT,1,1,3
Jason,1,1,3 Jason,1,1,3
Yehuda,1,1,3 Yehuda,1,1,3
"#, "#,

View file

@ -10,9 +10,9 @@ fn removes_duplicate_rows() {
r#" r#"
first_name,last_name,rusty_at,type first_name,last_name,rusty_at,type
Andrés,Robalino,10/11/2013,A Andrés,Robalino,10/11/2013,A
Jonathan,Turner,10/12/2013,B JT,Turner,10/12/2013,B
Yehuda,Katz,10/11/2013,A Yehuda,Katz,10/11/2013,A
Jonathan,Turner,10/12/2013,B JT,Turner,10/12/2013,B
Yehuda,Katz,10/11/2013,A Yehuda,Katz,10/11/2013,A
"#, "#,
)]); )]);
@ -39,9 +39,9 @@ fn uniq_values() {
r#" r#"
first_name,last_name,rusty_at,type first_name,last_name,rusty_at,type
Andrés,Robalino,10/11/2013,A Andrés,Robalino,10/11/2013,A
Jonathan,Turner,10/12/2013,B JT,Turner,10/12/2013,B
Yehuda,Katz,10/11/2013,A Yehuda,Katz,10/11/2013,A
Jonathan,Turner,10/12/2013,B JT,Turner,10/12/2013,B
Yehuda,Katz,10/11/2013,A Yehuda,Katz,10/11/2013,A
"#, "#,
)]); )]);

View file

@ -12,7 +12,7 @@ fn removes_duplicate_rows() {
Andrés,Robalino,10/11/2013,A Andrés,Robalino,10/11/2013,A
Afonso,Turner,10/12/2013,B Afonso,Turner,10/12/2013,B
Yehuda,Katz,10/11/2013,A Yehuda,Katz,10/11/2013,A
Jonathan,Turner,11/12/2011,O JT,Turner,11/12/2011,O
"#, "#,
)]); )]);

View file

@ -10,7 +10,7 @@ fn wrap_rows_into_a_row() {
r#" r#"
first_name,last_name first_name,last_name
Andrés,Robalino Andrés,Robalino
Jonathan,Turner JT,Turner
Yehuda,Katz Yehuda,Katz
"#, "#,
)]); )]);
@ -39,7 +39,7 @@ fn wrap_rows_into_a_table() {
r#" r#"
first_name,last_name first_name,last_name
Andrés,Robalino Andrés,Robalino
Jonathan,Turner JT,Turner
Yehuda,Katz Yehuda,Katz
"#, "#,
)]); )]);

View file

@ -82,7 +82,7 @@ fn infers_types() {
r#" r#"
first_name,last_name,rusty_luck,d first_name,last_name,rusty_luck,d
Andrés,Robalino,1,d Andrés,Robalino,1,d
Jonathan,Turner,1,d JT,Turner,1,d
Yehuda,Katz,1,d Yehuda,Katz,1,d
Jason,Gedge,1,d Jason,Gedge,1,d
"#, "#,
@ -109,7 +109,7 @@ fn from_csv_text_to_table() {
r#" r#"
first_name,last_name,rusty_luck first_name,last_name,rusty_luck
Andrés,Robalino,1 Andrés,Robalino,1
Jonathan,Turner,1 JT,Turner,1
Yehuda,Katz,1 Yehuda,Katz,1
"#, "#,
)]); )]);
@ -136,7 +136,7 @@ fn from_csv_text_with_separator_to_table() {
r#" r#"
first_name;last_name;rusty_luck first_name;last_name;rusty_luck
Andrés;Robalino;1 Andrés;Robalino;1
Jonathan;Turner;1 JT;Turner;1
Yehuda;Katz;1 Yehuda;Katz;1
"#, "#,
)]); )]);
@ -163,7 +163,7 @@ fn from_csv_text_with_tab_separator_to_table() {
r#" r#"
first_name last_name rusty_luck first_name last_name rusty_luck
Andrés Robalino 1 Andrés Robalino 1
Jonathan Turner 1 JT Turner 1
Yehuda Katz 1 Yehuda Katz 1
"#, "#,
)]); )]);
@ -189,7 +189,7 @@ fn from_csv_text_skipping_headers_to_table() {
"los_tres_amigos.txt", "los_tres_amigos.txt",
r#" r#"
Andrés,Robalino,1 Andrés,Robalino,1
Jonathan,Turner,1 JT,Turner,1
Yehuda,Katz,1 Yehuda,Katz,1
"#, "#,
)]); )]);

View file

@ -26,7 +26,7 @@ fn from_json_text_to_table() {
{ {
"katz": [ "katz": [
{"name": "Yehuda", "rusty_luck": 1}, {"name": "Yehuda", "rusty_luck": 1},
{"name": "Jonathan", "rusty_luck": 1}, {"name": "JT", "rusty_luck": 1},
{"name": "Andres", "rusty_luck": 1}, {"name": "Andres", "rusty_luck": 1},
{"name":"GorbyPuff", "rusty_luck": 1} {"name":"GorbyPuff", "rusty_luck": 1}
] ]
@ -50,7 +50,7 @@ fn from_json_text_recognizing_objects_independently_to_table() {
"katz.txt", "katz.txt",
r#" r#"
{"name": "Yehuda", "rusty_luck": 1} {"name": "Yehuda", "rusty_luck": 1}
{"name": "Jonathan", "rusty_luck": 1} {"name": "JT", "rusty_luck": 1}
{"name": "Andres", "rusty_luck": 1} {"name": "Andres", "rusty_luck": 1}
{"name":"GorbyPuff", "rusty_luck": 3} {"name":"GorbyPuff", "rusty_luck": 3}
"#, "#,

View file

@ -86,7 +86,7 @@ fn from_tsv_text_to_table() {
r#" r#"
first Name Last Name rusty_luck first Name Last Name rusty_luck
Andrés Robalino 1 Andrés Robalino 1
Jonathan Turner 1 JT Turner 1
Yehuda Katz 1 Yehuda Katz 1
"#, "#,
)]); )]);
@ -112,7 +112,7 @@ fn from_tsv_text_skipping_headers_to_table() {
"los_tres_amigos.txt", "los_tres_amigos.txt",
r#" r#"
Andrés Robalino 1 Andrés Robalino 1
Jonathan Turner 1 JT Turner 1
Yehuda Katz 1 Yehuda Katz 1
"#, "#,
)]); )]);

View file

@ -5,7 +5,7 @@ fn table_to_xml_text_and_from_xml_text_back_into_table() {
let actual = nu!( let actual = nu!(
cwd: "tests/fixtures/formats", pipeline( cwd: "tests/fixtures/formats", pipeline(
r#" r#"
open jonathan.xml open jt.xml
| to xml | to xml
| from xml | from xml
| get content | get content

View file

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/"> <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel> <channel>
<title>Jonathan Turner</title> <title>JT</title>
<link>http://www.jonathanturner.org</link> <link>http://www.jntrnr.com</link>
<atom:link href="http://www.jonathanturner.org/feed.xml" rel="self" type="application/rss+xml" /> <atom:link href="https://www.jntrnr.com/atom.xml" rel="self" type="application/rss+xml" />
<item> <item>
<title>Creating crossplatform Rust terminal apps</title> <title>Creating crossplatform Rust terminal apps</title>
@ -14,8 +14,8 @@
&lt;p&gt;Part of the adventure is not seeing the way ahead and going anyway.&lt;/p&gt; &lt;p&gt;Part of the adventure is not seeing the way ahead and going anyway.&lt;/p&gt;
</description> </description>
<pubDate>Mon, 05 Oct 2015 00:00:00 +0000</pubDate> <pubDate>Mon, 05 Oct 2015 00:00:00 +0000</pubDate>
<link>http://www.jonathanturner.org/2015/10/off-to-new-adventures.html</link> <link>https://www.jntrnr.com/off-to-new-adventures/</link>
<guid isPermaLink="true">http://www.jonathanturner.org/2015/10/off-to-new-adventures.html</guid> <guid isPermaLink="true">https://www.jntrnr.com/off-to-new-adventures/</guid>
</item> </item>
</channel> </channel>

View file

@ -148,7 +148,7 @@ mod it_evaluation {
fn takes_rows_of_nu_value_strings() { fn takes_rows_of_nu_value_strings() {
Playground::setup("it_argument_test_1", |dirs, sandbox| { Playground::setup("it_argument_test_1", |dirs, sandbox| {
sandbox.with_files(vec![ sandbox.with_files(vec![
EmptyFile("jonathan_likes_cake.txt"), EmptyFile("jt_likes_cake.txt"),
EmptyFile("andres_likes_arepas.txt"), EmptyFile("andres_likes_arepas.txt"),
]); ]);
@ -163,7 +163,7 @@ mod it_evaluation {
"# "#
)); ));
assert_eq!(actual.out, "jonathan_likes_cake.txt"); assert_eq!(actual.out, "jt_likes_cake.txt");
}) })
} }
@ -436,7 +436,7 @@ mod external_command_arguments {
"expands_table_of_primitives_to_positional_arguments", "expands_table_of_primitives_to_positional_arguments",
|dirs, sandbox| { |dirs, sandbox| {
sandbox.with_files(vec![ sandbox.with_files(vec![
EmptyFile("jonathan_likes_cake.txt"), EmptyFile("jt_likes_cake.txt"),
EmptyFile("andres_likes_arepas.txt"), EmptyFile("andres_likes_arepas.txt"),
EmptyFile("ferris_not_here.txt"), EmptyFile("ferris_not_here.txt"),
]); ]);
@ -450,7 +450,7 @@ mod external_command_arguments {
assert_eq!( assert_eq!(
actual.out, actual.out,
"andres_likes_arepas.txt ferris_not_here.txt jonathan_likes_cake.txt" "andres_likes_arepas.txt ferris_not_here.txt jt_likes_cake.txt"
); );
}, },
) )
@ -462,7 +462,7 @@ mod external_command_arguments {
"expands_table_of_primitives_to_positional_arguments", "expands_table_of_primitives_to_positional_arguments",
|dirs, sandbox| { |dirs, sandbox| {
sandbox.with_files(vec![ sandbox.with_files(vec![
EmptyFile("jonathan_likes_cake.txt"), EmptyFile("jt_likes_cake.txt"),
EmptyFile("andres_likes_arepas.txt"), EmptyFile("andres_likes_arepas.txt"),
EmptyFile("ferris_not_here.txt"), EmptyFile("ferris_not_here.txt"),
]); ]);

View file

@ -11,7 +11,7 @@ fn takes_rows_of_nu_value_strings_and_pipes_it_to_stdin_of_external() {
r#" r#"
name,rusty_luck,origin name,rusty_luck,origin
Jason,1,Canada Jason,1,Canada
Jonathan,1,New Zealand JT,1,New Zealand
Andrés,1,Ecuador Andrés,1,Ecuador
AndKitKatz,1,Estados Unidos AndKitKatz,1,Estados Unidos
"#, "#,
@ -103,7 +103,7 @@ fn subexpression_handles_dot() {
r#" r#"
name,rusty_luck,origin name,rusty_luck,origin
Jason,1,Canada Jason,1,Canada
Jonathan,1,New Zealand JT,1,New Zealand
Andrés,1,Ecuador Andrés,1,Ecuador
AndKitKatz,1,Estados Unidos AndKitKatz,1,Estados Unidos
"#, "#,