forked from extern/nushell
Re-enable some good tests, remove some bad tests (#7875)
I tackled some of the disabled `FIXME`/`#[ignore]` tests. Most were straightforward to re-enable, and a few of them did not deserve to be re-enabled. --------- Co-authored-by: Darren Schroeder <343840+fdncred@users.noreply.github.com>
This commit is contained in:
parent
f4d7d19370
commit
1f810cd26a
@ -17,8 +17,6 @@ fn cd_works_with_in_var() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: jt: needs more work
|
|
||||||
#[ignore]
|
|
||||||
#[test]
|
#[test]
|
||||||
fn filesystem_change_from_current_directory_using_relative_path() {
|
fn filesystem_change_from_current_directory_using_relative_path() {
|
||||||
Playground::setup("cd_test_1", |dirs, _| {
|
Playground::setup("cd_test_1", |dirs, _| {
|
||||||
@ -26,7 +24,7 @@ fn filesystem_change_from_current_directory_using_relative_path() {
|
|||||||
cwd: dirs.root(),
|
cwd: dirs.root(),
|
||||||
r#"
|
r#"
|
||||||
cd cd_test_1
|
cd cd_test_1
|
||||||
echo (pwd)
|
$env.PWD
|
||||||
"#
|
"#
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -34,16 +32,14 @@ fn filesystem_change_from_current_directory_using_relative_path() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: jt: needs more work
|
|
||||||
#[ignore]
|
|
||||||
#[test]
|
#[test]
|
||||||
fn filesystem_change_from_current_directory_using_absolute_path() {
|
fn filesystem_change_from_current_directory_using_absolute_path() {
|
||||||
Playground::setup("cd_test_2", |dirs, _| {
|
Playground::setup("cd_test_2", |dirs, _| {
|
||||||
let actual = nu!(
|
let actual = nu!(
|
||||||
cwd: dirs.test(),
|
cwd: dirs.test(),
|
||||||
r#"
|
r#"
|
||||||
cd "{}"
|
cd '{}'
|
||||||
echo (pwd)
|
$env.PWD
|
||||||
"#,
|
"#,
|
||||||
dirs.formats().display()
|
dirs.formats().display()
|
||||||
);
|
);
|
||||||
@ -52,8 +48,6 @@ fn filesystem_change_from_current_directory_using_absolute_path() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: jt: needs more work
|
|
||||||
#[ignore]
|
|
||||||
#[test]
|
#[test]
|
||||||
fn filesystem_switch_back_to_previous_working_directory() {
|
fn filesystem_switch_back_to_previous_working_directory() {
|
||||||
Playground::setup("cd_test_3", |dirs, sandbox| {
|
Playground::setup("cd_test_3", |dirs, sandbox| {
|
||||||
@ -64,7 +58,7 @@ fn filesystem_switch_back_to_previous_working_directory() {
|
|||||||
r#"
|
r#"
|
||||||
cd {}
|
cd {}
|
||||||
cd -
|
cd -
|
||||||
echo (pwd)
|
$env.PWD
|
||||||
"#,
|
"#,
|
||||||
dirs.test().display()
|
dirs.test().display()
|
||||||
);
|
);
|
||||||
@ -73,8 +67,6 @@ fn filesystem_switch_back_to_previous_working_directory() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: jt: needs more work
|
|
||||||
#[ignore]
|
|
||||||
#[test]
|
#[test]
|
||||||
fn filesystem_change_from_current_directory_using_relative_path_and_dash() {
|
fn filesystem_change_from_current_directory_using_relative_path_and_dash() {
|
||||||
Playground::setup("cd_test_4", |dirs, sandbox| {
|
Playground::setup("cd_test_4", |dirs, sandbox| {
|
||||||
@ -84,7 +76,7 @@ fn filesystem_change_from_current_directory_using_relative_path_and_dash() {
|
|||||||
cwd: dirs.test(),
|
cwd: dirs.test(),
|
||||||
r#"
|
r#"
|
||||||
cd odin/-
|
cd odin/-
|
||||||
echo (pwd)
|
$env.PWD
|
||||||
"#
|
"#
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -95,8 +87,6 @@ fn filesystem_change_from_current_directory_using_relative_path_and_dash() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: jt: needs more work
|
|
||||||
#[ignore]
|
|
||||||
#[test]
|
#[test]
|
||||||
fn filesystem_change_current_directory_to_parent_directory() {
|
fn filesystem_change_current_directory_to_parent_directory() {
|
||||||
Playground::setup("cd_test_5", |dirs, _| {
|
Playground::setup("cd_test_5", |dirs, _| {
|
||||||
@ -104,7 +94,7 @@ fn filesystem_change_current_directory_to_parent_directory() {
|
|||||||
cwd: dirs.test(),
|
cwd: dirs.test(),
|
||||||
r#"
|
r#"
|
||||||
cd ..
|
cd ..
|
||||||
echo (pwd)
|
$env.PWD
|
||||||
"#
|
"#
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -112,8 +102,6 @@ fn filesystem_change_current_directory_to_parent_directory() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: jt: needs more work
|
|
||||||
#[ignore]
|
|
||||||
#[test]
|
#[test]
|
||||||
fn filesystem_change_current_directory_to_two_parents_up_using_multiple_dots() {
|
fn filesystem_change_current_directory_to_two_parents_up_using_multiple_dots() {
|
||||||
Playground::setup("cd_test_6", |dirs, sandbox| {
|
Playground::setup("cd_test_6", |dirs, sandbox| {
|
||||||
@ -123,7 +111,7 @@ fn filesystem_change_current_directory_to_two_parents_up_using_multiple_dots() {
|
|||||||
cwd: dirs.test().join("foo/bar"),
|
cwd: dirs.test().join("foo/bar"),
|
||||||
r#"
|
r#"
|
||||||
cd ...
|
cd ...
|
||||||
echo (pwd)
|
$env.PWD
|
||||||
"#
|
"#
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -131,32 +119,6 @@ fn filesystem_change_current_directory_to_two_parents_up_using_multiple_dots() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: jt: needs more work
|
|
||||||
#[ignore]
|
|
||||||
#[test]
|
|
||||||
fn filesystem_change_current_directory_to_parent_directory_after_delete_cwd() {
|
|
||||||
Playground::setup("cd_test_7", |dirs, sandbox| {
|
|
||||||
sandbox.within("foo").mkdir("bar");
|
|
||||||
|
|
||||||
let actual = nu!(
|
|
||||||
cwd: dirs.test().join("foo/bar"),
|
|
||||||
r#"
|
|
||||||
rm {}/foo/bar
|
|
||||||
echo ","
|
|
||||||
cd ..
|
|
||||||
echo (pwd)
|
|
||||||
"#,
|
|
||||||
dirs.test().display()
|
|
||||||
);
|
|
||||||
|
|
||||||
let actual = actual.out.split(',').nth(1).unwrap();
|
|
||||||
|
|
||||||
assert_eq!(PathBuf::from(actual), *dirs.test().join("foo"));
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// FIXME: jt: needs more work
|
|
||||||
#[ignore]
|
|
||||||
#[test]
|
#[test]
|
||||||
fn filesystem_change_to_home_directory() {
|
fn filesystem_change_to_home_directory() {
|
||||||
Playground::setup("cd_test_8", |dirs, _| {
|
Playground::setup("cd_test_8", |dirs, _| {
|
||||||
@ -164,7 +126,7 @@ fn filesystem_change_to_home_directory() {
|
|||||||
cwd: dirs.test(),
|
cwd: dirs.test(),
|
||||||
r#"
|
r#"
|
||||||
cd ~
|
cd ~
|
||||||
echo (pwd)
|
$env.PWD
|
||||||
"#
|
"#
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -172,8 +134,6 @@ fn filesystem_change_to_home_directory() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: jt: needs more work
|
|
||||||
#[ignore]
|
|
||||||
#[test]
|
#[test]
|
||||||
fn filesystem_change_to_a_directory_containing_spaces() {
|
fn filesystem_change_to_a_directory_containing_spaces() {
|
||||||
Playground::setup("cd_test_9", |dirs, sandbox| {
|
Playground::setup("cd_test_9", |dirs, sandbox| {
|
||||||
@ -183,7 +143,7 @@ fn filesystem_change_to_a_directory_containing_spaces() {
|
|||||||
cwd: dirs.test(),
|
cwd: dirs.test(),
|
||||||
r#"
|
r#"
|
||||||
cd "robalino turner katz"
|
cd "robalino turner katz"
|
||||||
echo (pwd)
|
$env.PWD
|
||||||
"#
|
"#
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -194,8 +154,6 @@ fn filesystem_change_to_a_directory_containing_spaces() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: jt: needs more work
|
|
||||||
#[ignore]
|
|
||||||
#[test]
|
#[test]
|
||||||
fn filesystem_not_a_directory() {
|
fn filesystem_not_a_directory() {
|
||||||
Playground::setup("cd_test_10", |dirs, sandbox| {
|
Playground::setup("cd_test_10", |dirs, sandbox| {
|
||||||
@ -219,8 +177,6 @@ fn filesystem_not_a_directory() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: jt: needs more work
|
|
||||||
#[ignore]
|
|
||||||
#[test]
|
#[test]
|
||||||
fn filesystem_directory_not_found() {
|
fn filesystem_directory_not_found() {
|
||||||
Playground::setup("cd_test_11", |dirs, _| {
|
Playground::setup("cd_test_11", |dirs, _| {
|
||||||
@ -243,8 +199,6 @@ fn filesystem_directory_not_found() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: jt: needs more work
|
|
||||||
#[ignore]
|
|
||||||
#[test]
|
#[test]
|
||||||
fn filesystem_change_directory_to_symlink_relative() {
|
fn filesystem_change_directory_to_symlink_relative() {
|
||||||
Playground::setup("cd_test_12", |dirs, sandbox| {
|
Playground::setup("cd_test_12", |dirs, sandbox| {
|
||||||
@ -256,7 +210,7 @@ fn filesystem_change_directory_to_symlink_relative() {
|
|||||||
cwd: dirs.test().join("boo"),
|
cwd: dirs.test().join("boo"),
|
||||||
r#"
|
r#"
|
||||||
cd ../foo_link
|
cd ../foo_link
|
||||||
echo (pwd)
|
$env.PWD
|
||||||
"#
|
"#
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -28,8 +28,6 @@ fn skip_cell_rejection() {
|
|||||||
assert_eq!(actual.out, "txt");
|
assert_eq!(actual.out, "txt");
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: needs more work
|
|
||||||
#[ignore]
|
|
||||||
#[test]
|
#[test]
|
||||||
fn complex_nested_columns() {
|
fn complex_nested_columns() {
|
||||||
let actual = nu!(cwd: ".", pipeline(
|
let actual = nu!(cwd: ".", pipeline(
|
||||||
|
@ -82,8 +82,6 @@ fn with_env_hides_variables_in_parent_scope() {
|
|||||||
assert_eq!(actual.out, "11");
|
assert_eq!(actual.out, "11");
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: jt: needs more work
|
|
||||||
#[ignore]
|
|
||||||
#[test]
|
#[test]
|
||||||
fn with_env_shorthand_can_not_hide_variables() {
|
fn with_env_shorthand_can_not_hide_variables() {
|
||||||
let actual = nu!(
|
let actual = nu!(
|
||||||
|
@ -704,20 +704,6 @@ fn index_out_of_bounds() {
|
|||||||
assert!(actual.err.contains("too large"));
|
assert!(actual.err.contains("too large"));
|
||||||
}
|
}
|
||||||
|
|
||||||
//FIXME: jt - umm, do we actually want to support this?
|
|
||||||
#[ignore]
|
|
||||||
#[test]
|
|
||||||
fn dash_def() {
|
|
||||||
let actual = nu!(
|
|
||||||
cwd: ".",
|
|
||||||
r#"
|
|
||||||
def - [x, y] { $x - $y }; - 4 1
|
|
||||||
"#
|
|
||||||
);
|
|
||||||
|
|
||||||
assert_eq!(actual.out, "3");
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn negative_decimal_start() {
|
fn negative_decimal_start() {
|
||||||
let actual = nu!(
|
let actual = nu!(
|
||||||
|
Loading…
Reference in New Issue
Block a user