Revert "into cellpath command (#7417)" (#7523)

This reverts commit f0e93c2fa9 (PR #7417).

I'm currently [working on improving cell
paths](https://github.com/nushell/nushell/issues/7498#issuecomment-1356834798),
and I realized that I would need to make several improvements to `into
cellpath` along the lines of Jakub's comment here:
https://github.com/nushell/nushell/pull/7417#issuecomment-1345264955

I don't think `into cellpath` is quite ready for prime-time, and I'd
like to remove it before the upcoming release.
This commit is contained in:
Reilly Wood
2022-12-18 23:02:18 -08:00
committed by GitHub
parent 28123841ba
commit a21af0ade4
7 changed files with 0 additions and 170 deletions

View File

@ -25,8 +25,6 @@ use tempfile::NamedTempFile;
pub type TestResult = Result<(), Box<dyn std::error::Error>>;
const DEFAULT_CONFIG: &str = "./crates/nu-utils/src/sample_config/default_config.nu";
pub fn run_test_with_env(input: &str, expected: &str, env: &HashMap<&str, &str>) -> TestResult {
let mut file = NamedTempFile::new()?;
let name = file.path();
@ -56,25 +54,6 @@ pub fn run_test(input: &str, expected: &str) -> TestResult {
run_cmd_and_assert(cmd, expected)
}
#[cfg(test)]
pub fn run_test_with_default_config(input: &str, expected: &str) -> TestResult {
let mut file = NamedTempFile::new()?;
let name = file.path();
let mut cmd = Command::cargo_bin("nu")?;
cmd.arg("--config");
cmd.arg(DEFAULT_CONFIG);
cmd.arg(name);
cmd.env(
"PWD",
std::env::current_dir().expect("Can't get current dir"),
);
writeln!(file, "{}", input)?;
run_cmd_and_assert(cmd, expected)
}
#[cfg(test)]
fn run_cmd_and_assert(mut cmd: Command, expected: &str) -> TestResult {
let output = cmd.output()?;

View File

@ -1,7 +1,5 @@
use crate::tests::{run_test, TestResult};
use super::run_test_with_default_config;
#[test]
fn shorthand_env_1() -> TestResult {
run_test(r#"FOO=BAZ $env.FOO"#, "BAZ")
@ -24,11 +22,3 @@ fn convert_non_string_env_var_to_nothing() -> TestResult {
"nothing",
)
}
#[test]
fn convert_string_to_env_var_cellpath() -> TestResult {
run_test_with_default_config(
r#"let p = 'ls.use_ls_colors'; $env.config | upsert ($p | into cellpath) false | get ls.use_ls_colors"#,
"false",
)
}